Skip to content

Commit 80b82d5

Browse files
authored
Merge pull request #8687 from opensourcerouting/bgp-fix-mcast
yang: fix BGP multicast prefix specification
2 parents 10d52ac + 684a5c8 commit 80b82d5

File tree

3 files changed

+50
-46
lines changed

3 files changed

+50
-46
lines changed

yang/frr-bgp.yang

+10-10
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ module frr-bgp {
1111
prefix inet;
1212
}
1313

14-
import ietf-routing-types {
15-
prefix rt-types;
16-
}
17-
1814
import frr-interface {
1915
prefix frr-interface;
2016
}
@@ -23,6 +19,10 @@ module frr-bgp {
2319
prefix frr-bt;
2420
}
2521

22+
import frr-route-types {
23+
prefix frr-route-types;
24+
}
25+
2626
include "frr-bgp-common";
2727

2828
include "frr-bgp-common-structure";
@@ -405,7 +405,7 @@ module frr-bgp {
405405
description
406406
"A list of network routes.";
407407
leaf prefix {
408-
type rt-types:ipv4-multicast-group-address;
408+
type frr-route-types:ipv4-multicast-group-prefix;
409409
description
410410
"IPv4 multicast destination prefix.";
411411
}
@@ -425,7 +425,7 @@ module frr-bgp {
425425
description
426426
"A list of aggregated routes.";
427427
leaf prefix {
428-
type rt-types:ipv4-multicast-group-address;
428+
type frr-route-types:ipv4-multicast-group-prefix;
429429
description
430430
"IPv4 multicast destination prefix.";
431431
}
@@ -438,7 +438,7 @@ module frr-bgp {
438438
description
439439
"A list of routes with a particular admin distance.";
440440
leaf prefix {
441-
type rt-types:ipv4-multicast-group-address;
441+
type frr-route-types:ipv4-multicast-group-prefix;
442442
description
443443
"IPv4 multicast destination prefix.";
444444
}
@@ -459,7 +459,7 @@ module frr-bgp {
459459
description
460460
"A list of network routes.";
461461
leaf prefix {
462-
type rt-types:ipv6-multicast-group-address;
462+
type frr-route-types:ipv6-multicast-group-prefix;
463463
description
464464
"IPv6 multicast destination prefix.";
465465
}
@@ -479,7 +479,7 @@ module frr-bgp {
479479
description
480480
"A list of aggregated routes.";
481481
leaf prefix {
482-
type rt-types:ipv6-multicast-group-address;
482+
type frr-route-types:ipv6-multicast-group-prefix;
483483
description
484484
"IPv6 multicast destination prefix.";
485485
}
@@ -492,7 +492,7 @@ module frr-bgp {
492492
description
493493
"A list of routes with a particular admin distance.";
494494
leaf prefix {
495-
type rt-types:ipv6-multicast-group-address;
495+
type frr-route-types:ipv6-multicast-group-prefix;
496496
description
497497
"IPv6 multicast destination prefix.";
498498
}

yang/frr-pim-rp.yang

+5-36
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ module frr-pim-rp {
88
prefix "inet";
99
}
1010

11-
import ietf-routing-types {
12-
prefix "rt-types";
13-
}
14-
1511
import frr-routing {
1612
prefix "frr-rt";
1713
}
@@ -20,6 +16,10 @@ module frr-pim-rp {
2016
prefix "frr-pim";
2117
}
2218

19+
import frr-route-types {
20+
prefix frr-route-types;
21+
}
22+
2323
organization
2424
"FRRouting";
2525

@@ -63,37 +63,6 @@ module frr-pim-rp {
6363
"RFC XXXX: A YANG Data Model for PIM RP";
6464
}
6565

66-
typedef ipv4-multicast-group-address-prefix {
67-
type inet:ipv4-prefix{
68-
pattern '(2((2[4-9])|(3[0-9]))\.)(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){2}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(/(([4-9])|([1-2][0-9])|(3[0-2])))';
69-
}
70-
description
71-
"This type represents an IPv4 multicast group prefix,
72-
which is in the range from 224.0.0.0 to 239.255.255.255.";
73-
}
74-
75-
typedef ipv6-multicast-group-address-prefix {
76-
type inet:ipv6-prefix {
77-
pattern
78-
'(((FF|ff)[0-9a-fA-F]{2}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/((1[6-9])|([2-9][0-9])|(1[0-1][0-9])|(12[0-8])))';
79-
pattern
80-
'(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)(/.+)';
81-
}
82-
description
83-
"This type represents an IPv6 multicast group prefix,
84-
which is in the range of FF00::/8.";
85-
}
86-
87-
typedef ip-multicast-group-address-prefix {
88-
description "The IP-Multicast-Group-Address-Prefix type represents an IP multicast address
89-
prefix and is IP version neutral. The format of the textual representations implies the IP
90-
version. It includes a prefix-length, separated by a '/' sign.";
91-
type union {
92-
type ipv4-multicast-group-address-prefix;
93-
type ipv6-multicast-group-address-prefix;
94-
}
95-
} // typedef ip-multicast-group-address-prefix
96-
9766
typedef plist-ref {
9867
type string;
9968
}
@@ -124,7 +93,7 @@ module frr-pim-rp {
12493
description "Use group-list or prefix-list";
12594
case group-list {
12695
leaf-list group-list{
127-
type ip-multicast-group-address-prefix;
96+
type frr-route-types:ip-multicast-group-prefix;
12897
description
12998
"List of multicast group address.";
13099
}

yang/frr-route-types.yang

+35
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ module frr-route-types {
33
namespace "http://frrouting.org/yang/route-types";
44
prefix frr-route-types;
55

6+
import ietf-inet-types {
7+
prefix inet;
8+
}
9+
610
organization
711
"FRRouting";
812
contact
@@ -145,4 +149,35 @@ module frr-route-types {
145149
type frr-route-types-v6;
146150
}
147151
}
152+
153+
typedef ipv4-multicast-group-prefix {
154+
type inet:ipv4-prefix {
155+
pattern '(2((2[4-9])|(3[0-9]))\.)(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){2}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(/(([4-9])|([1-2][0-9])|(3[0-2])))';
156+
}
157+
description
158+
"This type represents an IPv4 multicast group prefix,
159+
which is in the range from 224.0.0.0 to 239.255.255.255.";
160+
}
161+
162+
typedef ipv6-multicast-group-prefix {
163+
type inet:ipv6-prefix {
164+
pattern
165+
'(((FF|ff)[0-9a-fA-F]{2}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/((1[6-9])|([2-9][0-9])|(1[0-1][0-9])|(12[0-8])))';
166+
pattern
167+
'(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)(/.+)';
168+
}
169+
description
170+
"This type represents an IPv6 multicast group prefix,
171+
which is in the range of FF00::/8.";
172+
}
173+
174+
typedef ip-multicast-group-prefix {
175+
description "The IP-Multicast-Group-Address-Prefix type represents an IP multicast address
176+
prefix and is IP version neutral. The format of the textual representations implies the IP
177+
version. It includes a prefix-length, separated by a '/' sign.";
178+
type union {
179+
type ipv4-multicast-group-prefix;
180+
type ipv6-multicast-group-prefix;
181+
}
182+
}
148183
}

0 commit comments

Comments
 (0)