-
Notifications
You must be signed in to change notification settings - Fork 4
/
netgate-common.yang
690 lines (588 loc) · 13 KB
/
netgate-common.yang
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
module netgate-common {
yang-version 1.1;
namespace "urn:netgate:xml:yang:netgate-common";
prefix "ngcom";
organization "Netgate";
contact "Web: <http://www.netgate.com>";
description
"Definitions of common elements (types, etc) used by multiple modules
of the Netgate router.
Copyright 2017-2020 Rubicon Communications, LLC. All rights reserved.";
revision 2023-02-15 {
description
"TNSR Release 23.02.";
}
revision 2022-02-15 {
description
"TNSR Release 22.02.";
}
revision 2021-06-15 {
description
"TNSR Release 21.07.";
}
revision 2021-02-15 {
description
"TNSR Release 21.02";
}
revision 2020-11-01 {
description
"TNSR Release 20.10.1";
}
revision 2020-06-15 {
description
"TNSR Release 20.06.";
}
revision 2020-02-15 {
description
"TNSR Release 20.02.";
}
revision 2019-05-30 {
description
"TNSR Release 19.05.";
}
revision 2019-02-15 {
description
"TNSR Release 19.02.";
}
revision 2017-06-16 {
description
"Initial revision.";
}
typedef identifier {
type string {
pattern '[a-zA-Z_][a-zA-Z0-9_-]*';
}
}
typedef identifier-31 {
type ngcom:identifier {
length "1..31";
}
}
typedef identifier-32 {
type ngcom:identifier {
length "1..32";
}
}
typedef identifier-63 {
type ngcom:identifier {
length "1..63";
}
}
typedef identifier-64 {
type ngcom:identifier {
length "1..64";
}
}
typedef string-xml-no-escape {
type string {
pattern "[^<>&\"']*";
}
}
typedef description-63 {
type ngcom:string-xml-no-escape {
length "1..63";
}
}
typedef if-identifier {
type string {
pattern '[a-zA-Z_][a-zA-Z0-9_/.-]*';
}
}
typedef if-identifier-31 {
type ngcom:if-identifier {
length "1..31";
}
}
typedef if-identifier-63 {
type ngcom:if-identifier {
length "1..63";
}
}
typedef rt-identifier-15 {
type string {
length "1..15";
pattern '[a-zA-Z_][a-zA-Z0-9_:-]*';
}
}
typedef linux-if-name {
type string {
length "1..15"; /* IFNAMSIZ and a NUL. */
pattern '[a-zA-Z_][a-zA-Z0-9_.-]*';
}
}
typedef host-if-name {
type linux-if-name;
}
typedef rt-identifier-63 {
type string {
length "1..63";
pattern '[a-zA-Z_][a-zA-Z0-9_:-]*';
}
}
typedef memory-size-string {
type string {
pattern '[1-9][0-9]*([kKmMgG])?';
}
description
"Memory size type.";
}
typedef memory-page-size {
type enumeration {
enum 4k;
enum 2m;
enum 1g;
enum default {
description
"default page size.";
}
}
description
"Enumeration of available page sizes.";
}
typedef ip-address-family {
type enumeration {
enum ipv4 {
description
"IPv4";
}
enum ipv6 {
description
"IPv6";
}
}
description
"Enumeration of basic IP address family types.";
}
typedef ip-protocol-bit {
type bits {
bit icmp {
position 1;
description "internet control message protocol";
}
bit igmp {
position 2;
description "Internet Group Management";
}
bit ggp {
position 3;
description "gateway-gateway protocol";
}
bit ipencap {
position 4;
description "IP encapsulated in IP (officially ``IP'')";
}
bit st {
position 5;
description "ST datagram mode";
}
bit tcp {
position 6;
description "transmission control protocol";
}
bit egp {
position 8;
description "exterior gateway protocol";
}
bit igp {
position 9;
description "any private interior gateway (Cisco)";
}
bit pup {
position 12;
description "PARC universal packet protocol";
}
bit udp {
position 17;
description "user datagram protocol";
}
bit hmp {
position 20;
description "host monitoring protocol";
}
bit xns-idp {
position 22;
description "Xerox NS IDP";
}
bit rdp {
position 27;
description "Reliable Datagram Protocol";
}
bit iso-tp4 {
position 29;
description "ISO Transport Protocol class 4 [RFC905]";
}
bit dccp {
position 33;
description "Datagram Congestion Control Prot. [RFC4340]";
}
bit xtp {
position 36;
description "Xpress Transfer Protocol";
}
bit ddp {
position 37;
description "Datagram Delivery Protocol";
}
bit idpr-cmtp {
position 38;
description "IDPR Control Message Transport";
}
bit ipv6 {
position 41;
description "Internet Protocol, version 6";
}
bit ipv6-route {
position 43;
description "Routing Header for IPv6";
}
bit ipv6-frag {
position 44;
description "Fragment Header for IPv6";
}
bit idrp {
position 45;
description "Inter-Domain Routing Protocol";
}
bit rsvp {
position 46;
description "Reservation Protocol";
}
bit gre {
position 47;
description "General Routing Encapsulation";
}
bit esp {
position 50;
description "Encap Security Payload [RFC2406]";
}
bit ah {
position 51;
description "Authentication Header [RFC2402]";
}
bit skip {
position 57;
description "SKIP";
}
bit ipv6-icmp {
position 58;
description "ICMP for IPv6";
}
bit ipv6-nonxt {
position 59;
description "No Next Header for IPv6";
}
bit ipv6-opts {
position 60;
description "Destination Options for IPv6";
}
bit rspf {
position 73;
description "Radio Shortest Path First (officially CPHB)";
}
bit vmtp {
position 81;
description "Versatile Message Transport";
}
bit eigrp {
position 88;
description "Enhanced Interior Routing Protocol (Cisco)";
}
bit ospf {
position 89;
description "Open Shortest Path First IGP";
}
bit ax.25 {
position 93;
description "AX.25 frames";
}
bit ipip {
position 94;
description "IP-within-IP Encapsulation Protocol";
}
bit etherip {
position 97;
description "Ethernet-within-IP Encapsulation [RFC3378]";
}
bit encap {
position 98;
description "Yet Another IP encapsulation [RFC1241]";
}
bit pim {
position 103;
description "Protocol Independent Multicast";
}
bit ipcomp {
position 108;
description "IP Payload Compression Protocol";
}
bit vrrp {
position 112;
description "Virtual Router Redundancy Protocol [RFC5798]";
}
bit l2tp {
position 115;
description "Layer Two Tunneling Protocol [RFC2661]";
}
bit isis {
position 124;
description "IS-IS over IPv4";
}
bit sctp {
position 132;
description "Stream Control Transmission Protocol";
}
bit fc {
position 133;
description "Fibre Channel";
}
bit mobility-header {
position 135;
description "Mobility Support for IPv6 [RFC3775]";
}
bit udplite {
position 136;
description "UDP-Lite [RFC3828]";
}
bit mpls-in-ip {
position 137;
description "MPLS-in-IP [RFC4023]";
}
bit manet {
position 138;
description "MANET Protocols [RFC5498]";
}
bit hip {
position 139;
description "Host Identity Protocol";
}
bit shim6 {
position 140;
description "Shim6 Protocol [RFC5533]";
}
bit wesp {
position 141;
description "Wrapped Encapsulating Security Payload";
}
bit rohc {
position 142;
description "Robust Header Compression";
}
}
}
typedef ip-protocol-number {
type uint8 {
range "0..255";
}
description "IP protocol number, [0-255]";
}
typedef ip-protocol-name-or-number {
type union {
type ip-protocol-bit;
type ip-protocol-number;
}
}
/*
* This pattern matches a set of intermixed, whitespace separated
* IP protocols by name or number.
* For example: "icmp 211 udp tcp 42".
*/
typedef ip-protocol-name-or-number-set {
type string {
pattern '(icmp|igmp|ggp|ipencap|st|tcp'
+ '|egp|igp|pup|udp|hmp|xns-idp'
+ '|rdp|iso-tp4|dccp|xtp|ddp|idpr-cmtp'
+ '|ipv6|ipv6-route|ipv6-frag|idrp'
+ '|rsvp|gre|esp|ah|skip|ipv6-icmp'
+ '|ipv6-nonxt|ipv6-opts|rspf|vmtp'
+ '|eigrp|ospf|ax[.]25|ipip|etherip'
+ '|encap|pim|ipcomp|vrrp|l2tp'
+ '|isis|sctp|fc|mobility-header'
+ '|udplite|mpls-in-ip|manet'
+ '|hip|shim6|wesp|rohc'
+ '|[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'
+ '((\s+)'
+ '(icmp|igmp|ggp|ipencap|st|tcp'
+ '|egp|igp|pup|udp|hmp|xns-idp'
+ '|rdp|iso-tp4|dccp|xtp|ddp|idpr-cmtp'
+ '|ipv6|ipv6-route|ipv6-frag|idrp'
+ '|rsvp|gre|esp|ah|skip|ipv6-icmp'
+ '|ipv6-nonxt|ipv6-opts|rspf|vmtp'
+ '|eigrp|ospf|ax[.]25|ipip|etherip'
+ '|encap|pim|ipcomp|vrrp|l2tp'
+ '|isis|sctp|fc|mobility-header'
+ '|udplite|mpls-in-ip|manet'
+ '|hip|shim6|wesp|rohc'
+ '|[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'
+ ')*';
}
}
typedef tcp-flags {
type bits {
bit fin {
position 0;
description
"This is the last packet from sender.";
}
bit syn {
position 1;
description
"Synchronize sequence numbers.";
}
bit rst {
position 2;
description
"Reset the connection.";
}
bit psh {
position 3;
description
"Request to push buffered data to receiver.";
}
bit ack {
position 4;
description
"Indicates that the acknowledgement number is valid.";
}
bit urg {
position 5;
description
"Indicates that the Urgent pointer field is valid.";
}
bit ece {
position 6;
description
"ECN echo.";
}
bit cwr {
position 7;
description
"Congestion window reduced.";
}
}
}
typedef ng-tunnel-type {
type enumeration {
enum none {
value 0;
description
"No tunnel";
}
enum ipsec {
value 1;
description
"IPsec (ESP)";
}
enum gre {
value 2;
description
"Generic Routing Encapsulation";
}
}
description
"Supported types of tunnel/encapsulation.";
}
typedef service-operation {
type enumeration {
enum start {
description
"Start if not already running";
}
enum stop {
description
"Stop if running";
}
enum restart {
description
"Stop if running, then start";
}
enum status {
description
"Check status";
}
}
description
"Common operations that can be performed on a service";
}
typedef service-op-enable-disable {
type enumeration {
enum enable {
description
"Enable option";
}
enum disable {
description
"Disable option";
}
}
}
feature netgate-has-netns {
description
"Enabling this feature asserts that the system supports
different network namespaces, notably 'host' and 'dataplane'
namespaces. Withoug this feature, host and dataplane are
same and represented by 'host'.";
}
typedef network-namespace {
type enumeration {
enum host {
description
"Host network namespace";
}
enum dataplane {
description
"Dataplane network namespace";
}
}
description
"Enumeration of available network namespaces.";
}
typedef database-name {
type enumeration {
enum running {
description
"The active database configuration";
}
enum candidate {
description
"The candidate database configuration";
}
enum startup {
description
"The startup database configuration";
}
}
}
/*
* OID expressed in IETF dot-form.
*
* Top level: 0 ~ 2
* 2nd level for 0 or 1: 0 ~ 39
* 2nd level for 2: any value 0 through 2^32 - 1
* 3rd level and beyond: any value 0 through 2^32 - 1
*
* Allow "absolute" OIDs with a leading ".".
* For views, an OID prefix at any level is allowed.
*/
typedef object-id-128 {
type string {
pattern '(((\.?)[0-1](\.[1-3]?[0-9]))'
+ '|((\.?)2\.(0|([1-9]\d*))))'
+ '(\.(0|([1-9]\d*)))*';
}
}
typedef object-id-view-128 {
type string {
pattern '((\.?)(0|1))'
+ '|(((\.?)(0|1)(\.([1-3]?[0-9])))(\.(0|[1-9]\d*))*)'
+ '|(((\.?)(2))(\.(0|[1-9]\d*))*)';
}
}
/*
* Base64 Encoded values
*/
typedef base64-encoding {
type string {
pattern '[A-Za-z0-9\+/]*=*';
}
}
}