-
Notifications
You must be signed in to change notification settings - Fork 694
Expand file tree
/
Copy pathopenconfig-bgp-types.yang
More file actions
859 lines (773 loc) · 29.1 KB
/
openconfig-bgp-types.yang
File metadata and controls
859 lines (773 loc) · 29.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
module openconfig-bgp-types {
yang-version "1";
namespace "http://openconfig.net/yang/bgp-types";
prefix "oc-bgp-types";
import openconfig-types { prefix "oc-types"; }
import openconfig-inet-types { prefix "oc-inet"; }
import openconfig-extensions { prefix "oc-ext"; }
// Include definitions of BGP error notifications
include openconfig-bgp-errors;
// meta
organization
"OpenConfig working group";
contact
"OpenConfig working group
netopenconfig@googlegroups.com";
description
"This module contains general data definitions for use in BGP
policy. It can be imported by modules that make use of BGP
attributes";
oc-ext:openconfig-version "6.2.0";
revision "2026-03-24" {
description
"Add bgp-aigp-metric typedef.";
reference "6.2.0";
}
revision "2024-09-06" {
description
"Restore NONE enum value for community-type.";
reference "6.1.0";
}
revision "2024-02-01" {
description
"Modify bgp-community-regexp-type.";
reference "6.0.0";
}
revision "2023-12-26" {
description
"Add regex for bgp link bandwidth";
reference "5.6.0";
}
revision "2023-09-06" {
description
"Add GRACEFUL_SHUTDOWN as a BGP_WELL_KNOWN_STD_COMMUNITY";
reference "5.5.0";
}
revision "2023-03-31" {
description
"Add support for BGP large communities [rfc8092] in
send-community
Types impacted:
- community-type";
reference "5.4.0";
}
revision "2021-08-06" {
description
"Fix pattern regexes to allow full 4-byte private ASN range including
42xxxxxxxx in extended communities
Types impacted:
- bgp-ext-community-type";
reference "5.3.1";
}
revision "2021-01-07" {
description
"Remove module extension oc-ext:regexp-posix by making pattern regexes
conform to RFC7950.
Types impacted:
- bgp-std-community-type
- bgp-ext-community-type";
reference "5.3.0";
}
revision "2020-06-30" {
description
"Add OpenConfig POSIX pattern extensions.";
reference "5.2.1";
}
revision "2020-06-17" {
description
"Add RFC5549 capability identity.";
reference "5.2.0";
}
revision "2020-03-24" {
description
"Add FlowSpec, BGP-LS and LSVR AFI-SAFI identities.";
reference "5.1.0";
}
revision "2018-11-21" {
description
"Add OpenConfig module metadata extensions.";
reference "5.0.2";
}
revision "2018-08-20" {
description
"Correct description of AFI-SAFI enabled leaf.";
reference "5.0.1";
}
revision "2018-04-11" {
description
"Correct naming of BGP maximum prefix warning percentage leaf.";
reference "5.0.0";
}
revision "2018-03-20" {
description
"Added SR-TE policy SAFI";
reference "4.1.0";
}
revision "2018-03-20" {
description
"Added color extended community";
reference "4.0.2";
}
revision "2017-07-30" {
description
"Clarification of add-paths send-max leaf";
reference "4.0.1";
}
revision "2017-07-10" {
description
"Add error notifications; moved add-paths config; add AS
prepend policy features; removed unneeded config leaves";
reference "4.0.0";
}
revision "2017-02-02" {
description
"Bugfix to remove remaining global-level policy data";
reference "3.0.1";
}
revision "2017-01-26" {
description
"Add dynamic neighbor support, migrate to OpenConfig types";
reference "3.0.0";
}
revision "2016-06-21" {
description
"OpenConfig BGP refactor";
reference "2.1.1";
}
// OpenConfig specific extensions for module metadata.
oc-ext:catalog-organization "openconfig";
oc-ext:origin "openconfig";
identity BGP_CAPABILITY {
description "Base identity for a BGP capability";
}
identity MPBGP {
base BGP_CAPABILITY;
description
"Multi-protocol extensions to BGP";
reference "RFC2858";
}
identity ROUTE_REFRESH {
base BGP_CAPABILITY;
description
"The BGP route-refresh functionality";
reference "RFC2918";
}
identity ASN32 {
base BGP_CAPABILITY;
description
"4-byte (32-bit) AS number functionality";
reference "RFC6793";
}
identity GRACEFUL_RESTART {
base BGP_CAPABILITY;
description
"Graceful restart functionality";
reference "RFC4724";
}
identity ADD_PATHS {
base BGP_CAPABILITY;
description
"BGP add-paths";
reference "draft-ietf-idr-add-paths";
}
identity EXTENDED_NEXTHOP_ENCODING {
base BGP_CAPABILITY;
description
"BGP Extended Next Hop Encoding functionality";
reference "RFC5549";
}
identity AFI_SAFI_TYPE {
description
"Base identity type for AFI,SAFI tuples for BGP-4";
reference "RFC4760 - multiprotocol extensions for BGP-4";
}
identity IPV4_UNICAST {
base AFI_SAFI_TYPE;
description
"IPv4 unicast (AFI,SAFI = 1,1)";
reference "RFC4760";
}
identity IPV6_UNICAST {
base AFI_SAFI_TYPE;
description
"IPv6 unicast (AFI,SAFI = 2,1)";
reference "RFC4760";
}
identity IPV4_LABELED_UNICAST {
base AFI_SAFI_TYPE;
description
"Labeled IPv4 unicast (AFI,SAFI = 1,4)";
reference "RFC3107";
}
identity IPV6_LABELED_UNICAST {
base AFI_SAFI_TYPE;
description
"Labeled IPv6 unicast (AFI,SAFI = 2,4)";
reference "RFC3107";
}
identity L3VPN_IPV4_UNICAST {
base AFI_SAFI_TYPE;
description
"Unicast IPv4 MPLS L3VPN (AFI,SAFI = 1,128)";
reference "RFC4364";
}
identity L3VPN_IPV6_UNICAST {
base AFI_SAFI_TYPE;
description
"Unicast IPv6 MPLS L3VPN (AFI,SAFI = 2,128)";
reference "RFC4659";
}
identity L3VPN_IPV4_MULTICAST {
base AFI_SAFI_TYPE;
description
"Multicast IPv4 MPLS L3VPN (AFI,SAFI = 1,129)";
reference "RFC6514";
}
identity L3VPN_IPV6_MULTICAST {
base AFI_SAFI_TYPE;
description
"Multicast IPv6 MPLS L3VPN (AFI,SAFI = 2,129)";
reference "RFC6514";
}
identity L2VPN_VPLS {
base AFI_SAFI_TYPE;
description
"BGP-signalled VPLS (AFI,SAFI = 25,65)";
reference "RFC4761";
}
identity L2VPN_EVPN {
base AFI_SAFI_TYPE;
description
"BGP MPLS Based Ethernet VPN (AFI,SAFI = 25,70)";
}
identity SRTE_POLICY_IPV4 {
base AFI_SAFI_TYPE;
description
"Segment Routing Traffic Engineering (SRTE) Policy
for IPv4 (AFI,SAFI = 1,73)";
}
identity SRTE_POLICY_IPV6 {
base AFI_SAFI_TYPE;
description
"Segment Routing Traffic Engineering (SRTE) Policy
for IPv6 (AFI,SAFI = 2,73)";
}
identity IPV4_FLOWSPEC {
base AFI_SAFI_TYPE;
description
"IPv4 dissemination of flow specification rules
(AFI,SAFI = 1,133)";
reference "RFC5575";
}
identity VPNV4_FLOWSPEC {
base AFI_SAFI_TYPE;
description
"IPv4 dissemination of flow specification rules
(AFI,SAFI = 1,134)";
reference "RFC5575";
}
identity LINKSTATE {
base AFI_SAFI_TYPE;
description
"BGP-LS (AFI,SAFI = 16388,71)";
reference "RFC7752";
}
identity LINKSTATE_VPN {
base AFI_SAFI_TYPE;
description
"BGP-LS-VPN (AFI,SAFI = 16388,72)";
reference "RFC7752";
}
identity LINKSTATE_SPF {
base AFI_SAFI_TYPE;
description
"BGP-LS SPF (AFI,SAFI = 16388,TBD)";
reference "draft-ietf-lsvr-bgp-spf";
}
identity BGP_WELL_KNOWN_STD_COMMUNITY {
description
"Reserved communities within the standard community space
defined by RFC1997. These communities must fall within the
range 0x00000000 to 0xFFFFFFFF";
reference "RFC1997";
}
identity NO_EXPORT {
base BGP_WELL_KNOWN_STD_COMMUNITY;
description
"Do not export NLRI received carrying this community outside
the bounds of this autonomous system, or this confederation if
the local autonomous system is a confederation member AS. This
community has a value of 0xFFFFFF01.";
reference "RFC1997";
}
identity NO_ADVERTISE {
base BGP_WELL_KNOWN_STD_COMMUNITY;
description
"All NLRI received carrying this community must not be
advertised to other BGP peers. This community has a value of
0xFFFFFF02.";
reference "RFC1997";
}
identity NO_EXPORT_SUBCONFED {
base BGP_WELL_KNOWN_STD_COMMUNITY;
description
"All NLRI received carrying this community must not be
advertised to external BGP peers - including over confederation
sub-AS boundaries. This community has a value of 0xFFFFFF03.";
reference "RFC1997";
}
identity NOPEER {
base BGP_WELL_KNOWN_STD_COMMUNITY;
description
"An autonomous system receiving NLRI tagged with this community
is advised not to readvertise the NLRI to external bi-lateral
peer autonomous systems. An AS may also filter received NLRI
from bilateral peer sessions when they are tagged with this
community value";
reference "RFC3765";
}
identity GRACEFUL_SHUTDOWN {
base BGP_WELL_KNOWN_STD_COMMUNITY;
description
"An autonomous system which supports the graceful shutdown
receiver procedure receiving NLRI tagged with this community
will set LOCAL_PREF to a low value for those NLRI. This
community has a value of 0xFFFF0000.";
reference "RFC8326";
}
typedef bgp-session-direction {
type enumeration {
enum INBOUND {
description
"Refers to all NLRI received from the BGP peer";
}
enum OUTBOUND {
description
"Refers to all NLRI advertised to the BGP peer";
}
}
description
"Type to describe the direction of NLRI transmission";
}
typedef bgp-well-known-community-type {
type identityref {
base BGP_WELL_KNOWN_STD_COMMUNITY;
}
description
"Type definition for well-known IETF community attribute
values";
reference
"IANA Border Gateway Protocol (BGP) Well Known Communities";
}
typedef bgp-std-community-type {
// TODO: further refine restrictions and allowed patterns
// 4-octet value:
// <as number> 2 octets
// <community value> 2 octets
type union {
type uint32 {
// per RFC 1997, 0x00000000 - 0x0000FFFF and 0xFFFF0000 -
// 0xFFFFFFFF are reserved
}
type string {
pattern '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}' +
'|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9]):' +
'(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}' +
'|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9])';
oc-ext:posix-pattern '^(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}' +
'|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9]):' +
'(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}' +
'|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9])$';
}
}
description
"Type definition for standard commmunity attributes represented as
a integer value, or a string of the form N:M where N and M are
integers between 0 and 65535.";
reference "RFC 1997 - BGP Communities Attribute";
}
typedef bgp-ext-community-type {
type union {
type string {
// Type 1: 2-octet global and 4-octet local
// (AS number) (Integer)
pattern '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}' +
'|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9]):' +
'(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' +
'|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' +
'429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[0-1][0-9]{8}|[1-3][0-9]{9}|' +
'[1-9][0-9]{1,8}|[0-9])';
oc-ext:posix-pattern '^(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}' +
'|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9]):' +
'(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' +
'|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' +
'429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[0-1][0-9]{8}|[1-3][0-9]{9}|' +
'[1-9][0-9]{1,8}|[0-9])$';
}
type string {
// Type 2: 4-octet global and 2-octet local
// (ipv4-address) (integer)
pattern '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|' +
'25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|' +
'2[0-4][0-9]|25[0-5]):' +
'(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}' +
'|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9])';
oc-ext:posix-pattern '^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|' +
'25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|' +
'2[0-4][0-9]|25[0-5]):' +
'(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}' +
'|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9])$';
}
type string {
// RFC5668: 4-octet global and 2-octet local
// (AS number) (integer)
pattern '(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' +
'|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' +
'429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[0-1][0-9]{8}|[1-3][0-9]{9}|' +
'[1-9][0-9]{1,8}|[0-9]):' +
'(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}' +
'|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9])';
oc-ext:posix-pattern '^(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' +
'|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' +
'429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[0-1][0-9]{8}|[1-3][0-9]{9}|' +
'[1-9][0-9]{1,8}|[0-9]):' +
'(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}' +
'|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9])$';
}
type string {
// route-target with Type 1
// route-target:(ASN):(local-part)
pattern 'route\-target:' +
'(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}' +
'|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9]):' +
'(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' +
'|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' +
'429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[0-1][0-9]{8}|[1-3][0-9]{9}|' +
'[1-9][0-9]{1,8}|[0-9])';
oc-ext:posix-pattern '^route\-target:' +
'(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}' +
'|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9]):' +
'(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' +
'|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' +
'429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[0-1][0-9]{8}|[1-3][0-9]{9}|' +
'[1-9][0-9]{1,8}|[0-9])$';
}
type string {
// route-target with Type 2
// route-target:(IPv4):(local-part)
pattern 'route\-target:' +
'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|' +
'25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|' +
'2[0-4][0-9]|25[0-5]):' +
'(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}' +
'|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9])';
oc-ext:posix-pattern '^route\-target:' +
'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|' +
'25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|' +
'2[0-4][0-9]|25[0-5]):' +
'(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}' +
'|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9])$';
}
type string {
// 4-byte AS Type 1 route-target
pattern 'route\-target:' +
'(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' +
'|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' +
'429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[0-1][0-9]{8}|[1-3][0-9]{9}|' +
'[1-9][0-9]{1,8}|[0-9]):' +
'(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}' +
'|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9])';
oc-ext:posix-pattern '^route\-target:' +
'(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' +
'|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' +
'429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[0-1][0-9]{8}|[1-3][0-9]{9}|' +
'[1-9][0-9]{1,8}|[0-9]):' +
'(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}' +
'|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9])$';
}
type string {
// route-origin with Type 1
pattern 'route\-origin:' +
'(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}' +
'|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9]):' +
'(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' +
'|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' +
'429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[0-1][0-9]{8}|[1-3][0-9]{9}|' +
'[1-9][0-9]{1,8}|[0-9])';
oc-ext:posix-pattern '^route\-origin:' +
'(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}' +
'|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9]):' +
'(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' +
'|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' +
'429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[0-1][0-9]{8}|[1-3][0-9]{9}|' +
'[1-9][0-9]{1,8}|[0-9])$';
}
type string {
// route-origin with Type 2
pattern 'route\-origin:' +
'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|' +
'25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|' +
'2[0-4][0-9]|25[0-5]):' +
'(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}' +
'|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9])';
oc-ext:posix-pattern '^route\-origin:' +
'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|' +
'25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|' +
'2[0-4][0-9]|25[0-5]):' +
'(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}' +
'|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9])$';
}
type string {
// 4-byte AS Type 1 route-origin
pattern 'route\-origin:' +
'(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' +
'|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' +
'429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[0-1][0-9]{8}|[1-3][0-9]{9}|' +
'[1-9][0-9]{1,8}|[0-9]):' +
'(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}' +
'|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9])';
oc-ext:posix-pattern '^route\-origin:' +
'(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' +
'|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' +
'429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[0-1][0-9]{8}|[1-3][0-9]{9}|' +
'[1-9][0-9]{1,8}|[0-9]):' +
'(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}' +
'|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9])$';
}
type string {
// Extended Color Community
pattern 'color:' +
'[0-1]{2}:' +
'(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' +
'|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' +
'429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[0-1][0-9]{8}|[1-3][0-9]{9}|' +
'[1-9][0-9]{1,8}|[0-9])';
oc-ext:posix-pattern '^color:' +
'[0-1]{2}:' +
'(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' +
'|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' +
'429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[0-1][0-9]{8}|[1-3][0-9]{9}|' +
'[1-9][0-9]{1,8}|[0-9])$';
}
type string {
// Extended Link Bandwidth Community
// link-bandwidth:<2 byte asn>:<bandwidth value in bits/sec,
// optionally with Kilo/Mega/Giga suffix>
// Example: link-bandwidth:20:100M
pattern 'link-bandwidth:' +
'(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}' +
'|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9]):' +
'(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' +
'|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' +
'429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[0-1][0-9]{8}|[1-3][0-9]{9}|' +
'[1-9][0-9]{1,8}|[0-9])(k|K|M|G)?';
oc-ext:posix-pattern '^link-bandwidth:' +
'(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}' +
'|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9])$' +
'(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' +
'|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' +
'429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[0-1][0-9]{8}|[1-3][0-9]{9}|' +
'[1-9][0-9]{1,8}|[0-9])(k|K|M|G)?$';
}
}
description
"Type definition for extended community attributes. In the case that
common communities are utilised, they are represented as a string
of the form:
- <2b AS>:<4b value> per RFC4360 section 3.1
- <4b IPv4>:<2b value> per RFC4360 section 3.2
- <4b AS>:<2b value> per RFC5668 section 2.
- route-target:<2b AS>:<4b value> per RFC4360 section 4
- route-target:<4b IPv4>:<2b value> per RFC4360 section 4
- route-origin:<2b ASN>:<4b value> per RFC4360 section 5
- route-origin:<4b IPv4>:<2b value> per RFC4360 section 5
- color:<CO bits>:<4b value> per draft-ietf-idr-segment-routing-te-policy
section 3
- link-bandwidth:<2 byte asn>:<bandwidth_value> per
draft-ietf-idr-link-bandwidth-07";
reference
"RFC 4360 - BGP Extended Communities Attribute
RFC 5668 - 4-Octet AS Specific BGP Extended Community
draft-ietf-idr-segment-routing-te-policy
draft-ietf-idr-link-bandwidth-07";
}
typedef bgp-ext-community-recv-type {
type union {
type bgp-ext-community-type;
type binary {
length 8;
}
}
description
"A type definition utilised to define the extended community
in a context where the system is receiving the extended
community from an external source, such that the value may be
unknown. In the case that the received extended community is
unknown it is defined to be a 8-octet quantity formatted
according to RFC4360:
Type Field: 1 or 2 octets.
Value Field: Remaining octets.
The high-order octet of the type field is encoded such that
bit 0 indicates whether the extended community type is IANA
assigned; and bit 1 indicates whether the extended community
is transitive. The remaining bits of the high-order type
field must be interpreted to determine whether the low-order
type field should be parsed, or whether the entire remainder
of the extended community is a value.";
reference
"RFC 4360 - BGP Extended Communities Attribute
RFC 5668 - 4-Octet AS Specific BGP Extended Community";
}
typedef bgp-community-regexp-type {
type oc-types:posix-eregexp;
description
"Type definition for communities specified as regular
expression patterns. The regular expression must be a
POSIX extended regular expression with some limitations
which are commonly found in device implementations described
in draft-ietf-idr-bgp-model.";
reference
"draft-ietf-idr-bgp-model";
}
typedef bgp-origin-attr-type {
type enumeration {
enum IGP {
description
"Origin of the NLRI is internal";
}
enum EGP {
description
"Origin of the NLRI is EGP";
}
enum INCOMPLETE {
description
"Origin of the NLRI is neither IGP or EGP";
}
}
description
"Type definition for standard BGP origin attribute";
reference "RFC 4271 - A Border Gateway Protocol 4 (BGP-4),
Sec 4.3";
}
typedef peer-type {
type enumeration {
enum INTERNAL {
description
"Internal (iBGP) peer";
}
enum EXTERNAL {
description
"External (eBGP) peer";
}
}
description
"Labels a peer or peer group as explicitly internal or
external";
}
identity REMOVE_PRIVATE_AS_OPTION {
description
"Base identity for options for removing private autonomous
system numbers from the AS_PATH attribute";
}
identity PRIVATE_AS_REMOVE_ALL {
base REMOVE_PRIVATE_AS_OPTION;
description
"Strip all private autonmous system numbers from the AS_PATH.
This action is performed regardless of the other content of the
AS_PATH attribute, and for all instances of private AS numbers
within that attribute.";
}
identity PRIVATE_AS_REPLACE_ALL {
base REMOVE_PRIVATE_AS_OPTION;
description
"Replace all instances of private autonomous system numbers in
the AS_PATH with the local BGP speaker's autonomous system
number. This action is performed regardless of the other
content of the AS_PATH attribute, and for all instances of
private AS number within that attribute.";
}
typedef remove-private-as-option {
type identityref {
base REMOVE_PRIVATE_AS_OPTION;
}
description
"Set of options for configuring how private AS path numbers
are removed from advertisements";
}
typedef rr-cluster-id-type {
type union {
type uint32;
type oc-inet:ipv4-address;
}
description
"Union type for route reflector cluster ids:
option 1: 4-byte number
option 2: IP address";
}
typedef community-type {
type enumeration {
enum STANDARD {
description "Send standard communities";
}
enum EXTENDED {
description "Send extended communities";
}
enum LARGE {
description "Send large communities";
}
enum BOTH {
description
"Send both standard and extended communities.
This value has been deprecated because the node is now
a leaf-list.";
status deprecated;
}
enum NONE {
description
"Do not send any community attribute. If this value is present
then the other community-types must not be present.";
}
}
description
"type describing variations of community attributes:
STANDARD: standard BGP community [rfc1997]
EXTENDED: extended BGP community [rfc4360]
LARGE: large BGP community [rfc8092]";
}
typedef as-path-segment-type {
type enumeration {
enum AS_SEQ {
description
"Ordered set of autonomous systems that a route in
the UPDATE message has traversed";
}
enum AS_SET {
description
"Unordered set of autonomous systems that a route in
the UPDATE message has traversed";
}
enum AS_CONFED_SEQUENCE {
description
"Ordered set of Member Autonomous
Systems in the local confederation that the UPDATE message
has traversed";
}
enum AS_CONFED_SET {
description
"Unordered set of Member Autonomous Systems
in the local confederation that the UPDATE message has
traversed";
}
}
description
"Defines the types of BGP AS path segments.";
}
typedef bgp-aigp-metric {
type uint64;
description
"Higher-precision metric, also known as Accumulated IGP
Metric [RFC7311].";
reference
"RFC 7311 - The Accumulated IGP Metric Attribute for BGP";
}
}