]> git.proxmox.com Git - mirror_frr.git/blob - yang/frr-pim.yang
Merge pull request #13276 from pguibert6WIND/explicit_null_complement
[mirror_frr.git] / yang / frr-pim.yang
1 // SPDX-License-Identifier: BSD-2-Clause
2 module frr-pim {
3 yang-version "1.1";
4 namespace "http://frrouting.org/yang/pim";
5
6 prefix frr-pim;
7
8 import frr-interface {
9 prefix frr-interface;
10 }
11
12 import frr-routing {
13 prefix "frr-rt";
14 }
15
16 import ietf-routing-types {
17 prefix "rt-types";
18 }
19
20 import ietf-inet-types {
21 prefix "inet";
22 }
23
24 organization
25 "FRRouting";
26
27 contact
28 "FRR Users List: <mailto:frog@lists.frrouting.org>
29 FRR Development List: <mailto:dev@lists.frrouting.org>";
30
31 description
32 "The module defines a collection of YANG definitions common for
33 PIM (Protocol Independent Multicast) model.
34
35 Copyright 2020 FRRouting
36
37 Redistribution and use in source and binary forms, with or without
38 modification, are permitted provided that the following conditions
39 are met:
40
41 1. Redistributions of source code must retain the above copyright notice,
42 this list of conditions and the following disclaimer.
43
44 2. Redistributions in binary form must reproduce the above copyright
45 notice, this list of conditions and the following disclaimer in the
46 documentation and/or other materials provided with the distribution.
47
48 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
49 \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
50 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
51 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
52 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
53 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
54 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
55 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
56 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
57 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
58 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
59
60 revision 2021-11-22 {
61 description
62 "Initial revision.";
63 reference
64 "RFC XXXX: A YANG Data Model for PIM";
65 }
66
67 identity pimd {
68 base frr-rt:routing-protocol;
69 description
70 "'Pim' routing pseudo-protocol.";
71 }
72
73 typedef plist-ref {
74 type string;
75 }
76
77 /*
78 * Groupings
79 */
80
81 grouping msdp-timers {
82 leaf hold-time {
83 type uint16 {
84 range "1..max";
85 }
86 units seconds;
87 default 75;
88 description
89 "Hold period is started at the MSDP peer connection establishment
90 and is reset every new message. When the period expires the
91 connection is closed. This value should be greater than the
92 remote keep-alive time.";
93 }
94
95 leaf keep-alive {
96 type uint16 {
97 range "1..max";
98 }
99 units seconds;
100 default 60;
101 description
102 "To maintain a connection established it is necessary to send
103 keep alive messages in a certain frequency and this allows its
104 configuration. This value should be less than the remote
105 hold time.";
106 }
107
108 leaf connection-retry {
109 type uint16 {
110 range "1..max";
111 }
112 units seconds;
113 default 30;
114 description
115 "This period is used in the MSDP peer with the highest IP value
116 in the pair and configures the interval between TCP connection
117 attempts.";
118 }
119 }
120
121 grouping global-pim-config-attributes {
122 description
123 "A grouping defining per address family pim global attributes";
124
125 leaf ecmp {
126 type boolean;
127 default "false";
128 description
129 "Enable PIM ECMP.";
130 }
131
132 leaf ecmp-rebalance {
133 type boolean;
134 default "false";
135 description
136 "Enable PIM ECMP Rebalance.";
137 }
138
139 leaf keep-alive-timer {
140 type uint16 {
141 range "1..max";
142 }
143 default "210";
144 description
145 "Keep alive Timer in seconds.";
146 }
147
148 leaf rp-keep-alive-timer {
149 type uint16 {
150 range "1..max";
151 }
152 default "210";
153 description
154 "RP keep alive Timer in seconds.";
155 }
156
157 leaf send-v6-secondary {
158 when "../frr-pim:address-family = 'frr-rt:ipv4'" {
159 description
160 "Only applicable to IPv4 address family.";
161 }
162 type boolean;
163 default "true";
164 description
165 "Send v6 secondary addresses.";
166 }
167
168 container spt-switchover {
169 description
170 "SPT-Switchover.";
171
172 leaf spt-action {
173 type enumeration {
174 enum "PIM_SPT_IMMEDIATE" {
175 value 0;
176 description
177 "Immediate switch to SPT Tree.";
178 }
179 enum "PIM_SPT_INFINITY" {
180 value 1;
181 description
182 "Never switch to SPT Tree.";
183 }
184 }
185 default "PIM_SPT_IMMEDIATE";
186 description
187 "SPT-Switchover action";
188 }
189
190 leaf spt-infinity-prefix-list {
191 when "../spt-action = 'PIM_SPT_INFINITY'" {
192 description
193 "This leaf is only valid when the spt action
194 is PIM_SPT_INFINITY.";
195 }
196 type plist-ref;
197 description
198 "Prefix-List to control which groups to switch.";
199 }
200 }
201
202 leaf ssm-prefix-list {
203 type plist-ref;
204 description
205 "Prefix-list used to define Source-Specific Multicast address range.";
206 }
207
208 leaf-list ssm-pingd-source-ip {
209 type inet:ip-address;
210 description
211 "Enable ssmpingd operation.";
212 }
213
214 /* Global timers configuration. */
215 container msdp {
216 description "Global MSDP configuration.";
217 uses msdp-timers;
218 }
219
220 list msdp-mesh-groups {
221 key "name";
222 description
223 "RFC 3618 Section 10.2. MSDP mesh-group semantics
224
225 Groups multiple MSDP peers to reduce SA flooding typically used
226 in intra-domain settings.";
227
228 leaf name {
229 type string {
230 length 1..64;
231 }
232 description
233 "The mesh group name.";
234 }
235
236 leaf source {
237 type inet:ip-address;
238 description
239 "Source IP address for the TCP connections.";
240 }
241
242 list members {
243 key "address";
244
245 leaf address {
246 type inet:ip-address;
247 description
248 "Peer member IP address.";
249 }
250 }
251 }
252
253 list msdp-peer {
254 key "peer-ip";
255 description
256 "Configure MSDP peer.";
257
258 leaf peer-ip {
259 type inet:ip-address;
260 description
261 "MSDP peer IP address.";
262 }
263
264 leaf source-ip {
265 mandatory true;
266 type inet:ip-address;
267 description
268 "MSDP source IP address.";
269 }
270 }
271
272 container mlag {
273 presence
274 "Multi-chassis link aggregation.";
275
276 leaf peerlink-rif {
277 type frr-interface:interface-ref;
278 description
279 "Outgoing interface name.";
280 }
281
282 leaf reg-address {
283 type inet:ip-address;
284 description
285 "reg address.";
286 }
287
288 leaf my-role {
289 type enumeration {
290 enum "MLAG_ROLE_NONE" {
291 value 0;
292 description
293 "MLAG role none.";
294 }
295 enum "MLAG_ROLE_PRIMARY" {
296 value 1;
297 description
298 "MLAG role primary.";
299 }
300
301 enum "MLAG_ROLE_SECONDARY" {
302 value 2;
303 description
304 "MLAG role secondary.";
305 }
306 }
307 default "MLAG_ROLE_NONE";
308 description
309 "Mlag role.";
310 }
311
312 leaf peer-state {
313 type boolean;
314 default "false";
315 description
316 "Peer state";
317 }
318 }
319
320 leaf register-accept-list {
321 type plist-ref;
322 description
323 "Only accept registers from a specific source prefix list.";
324 }
325 } // global-pim-config-attributes
326
327 grouping interface-pim-config-attributes {
328 description
329 "A grouping defining pim interface attributes per address family.";
330
331 leaf pim-enable {
332 type boolean;
333 default "false";
334 description
335 "Enable PIM flag on the interface.";
336 }
337
338 leaf pim-passive-enable {
339 type boolean;
340 default "false";
341 description
342 "Disable exchange of protocol packets.";
343 }
344
345 leaf hello-interval {
346 type uint8 {
347 range "1..max";
348 }
349 default "30";
350 description
351 "Hello interval";
352 }
353
354 leaf hello-holdtime {
355 type uint16 {
356 range "1..max";
357 }
358 must ". > ./../hello-interval" {
359 error-message "HoldTime must be greater than Hello";
360 }
361 description
362 "Hello holdtime";
363 }
364
365 container bfd {
366 presence
367 "Enable BFD support on the interface.";
368
369 leaf min-rx-interval {
370 type uint16 {
371 range "1..max";
372 }
373 default "300";
374 description
375 "Required min receive interval";
376 }
377
378 leaf min-tx-interval {
379 type uint16 {
380 range "1..max";
381 }
382 default "300";
383 description
384 "Desired min transmit interval";
385 }
386
387 leaf detect_mult {
388 type uint8 {
389 range "2..255";
390 }
391 default "3";
392 description
393 "Detect Multiplier";
394 }
395
396 leaf profile {
397 type string;
398 description
399 "Use a preconfigure BFD profile.";
400 }
401 }
402
403 leaf bsm {
404 type boolean;
405 default "true";
406 description
407 "Enables BSM support on the interface.";
408 }
409
410 leaf unicast-bsm {
411 type boolean;
412 default "true";
413 description
414 "Accept/Send unicast BSM on the interface.";
415 }
416
417 leaf active-active {
418 type boolean;
419 default "false";
420 description
421 "Mark interface as Active-Active for MLAG operations.";
422 }
423
424 leaf dr-priority {
425 type uint32 {
426 range "1..max";
427 }
428 default 1;
429 description
430 "DR (Designated Router) priority";
431 }
432
433 leaf use-source {
434 type inet:ip-address;
435 description
436 "Primary address of the interface set by user.";
437 }
438
439 leaf multicast-boundary-oil {
440 type plist-ref;
441 description
442 "Prefix-List to define multicast boundary";
443 }
444
445 list mroute {
446 key "source-addr group-addr";
447 description
448 "Add multicast route.";
449
450 leaf oif {
451 type frr-interface:interface-ref;
452 description
453 "Outgoing interface name.";
454 }
455
456 leaf source-addr {
457 type inet:ip-address;
458 description
459 "Multicast source address.";
460 }
461
462 leaf group-addr {
463 type rt-types:ip-multicast-group-address;
464 description
465 "Multicast group address.";
466 }
467 }
468 } // interface-pim-config-attributes
469
470 grouping router-pim-config-attributes {
471 description
472 "A grouping defining pim router attributes per address family.";
473 leaf packets {
474 type uint8 {
475 range "1..max";
476 }
477 default "3";
478 description
479 "Number of packets to process at one time per fd.";
480 }
481 leaf join-prune-interval {
482 type uint16 {
483 range "1..max";
484 }
485 default "60";
486 description
487 "Join Prune Send Interval in seconds.";
488 }
489 leaf register-suppress-time {
490 type uint16 {
491 range "1..max";
492 }
493 default "60";
494 description
495 "Register Suppress Timer.";
496 }
497 }
498
499 /*
500 * Global Configuration data nodes
501 */
502 augment "/frr-rt:routing/frr-rt:control-plane-protocols/"
503 + "frr-rt:control-plane-protocol" {
504 container pim {
505 when "../frr-rt:type = 'frr-pim:pimd'" {
506 description
507 "This container is only valid for the 'pim' routing
508 protocol.";
509 }
510 description
511 "PIM configuration data.";
512 list address-family {
513 key "address-family";
514 description
515 "Each list entry for one address family.";
516 uses frr-rt:address-family;
517 uses global-pim-config-attributes;
518
519 } //address-family
520 } // pim
521 } // augment
522
523 /*
524 * Per-interface configuration data
525 */
526 augment "/frr-interface:lib/frr-interface:interface" {
527 container pim {
528 list address-family {
529 key "address-family";
530 description
531 "Each list entry for one address family.";
532 uses frr-rt:address-family;
533 uses interface-pim-config-attributes;
534 }
535 }
536 }
537
538 /*
539 * Router configuration data
540 */
541 container pim {
542 description
543 "PIM router parameters.";
544 list address-family {
545 key "address-family";
546 description
547 "Each list entry for one address family.";
548 uses frr-rt:address-family;
549 uses router-pim-config-attributes;
550 }
551 }
552 }