-
Notifications
You must be signed in to change notification settings - Fork 4
/
netgate-system.yang
946 lines (808 loc) · 18.9 KB
/
netgate-system.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
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
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
module netgate-system {
yang-version 1.1;
namespace "urn:netgate:xml:yang:netgate-system";
prefix "ngsys";
import ietf-inet-types {
prefix "inet";
}
import netgate-cli-extensions {
prefix "ngcliext";
}
import netgate-common {
prefix "ngcom";
}
import netgate-radius {
prefix "ngradius";
}
import netgate-ldap {
prefix "ngldap";
}
organization "Netgate";
contact "Web: <http://www.netgate.com>";
description
"This YANG module provides a Netgate-defined data-model
for SYSTEM data.
Copyright 2018-2024 Rubicon Communications, LLC.
";
revision 2024-02-01 {
description
"TNSR Release 24.02.";
}
revision 2023-02-01 {
description
"TNSR Release 23.02.";
}
revision 2022-06-15 {
description
"TNSR Release 22.06.";
}
revision 2022-02-15 {
description
"TNSR Release 22.02.";
}
revision 2021-11-15 {
description
"TNSR Release 21.11.";
}
revision 2021-02-15 {
description
"TNSR Release 21.02.";
}
revision 2020-06-15 {
description
"TNSR Release 20.06.";
}
revision 2020-02-15 {
description
"TNSR Release 20.02.";
}
revision 2019-08-30 {
description
"TNSR Release 19.08.";
}
revision 2019-05-30 {
description
"TNSR Release 19.05.";
}
revision 2017-11-01 {
description
"Initial revision.";
}
typedef system-device-type-t {
type enumeration {
enum network {
description
"Network device (NIC)";
}
enum crypto-vf {
description
"Crypto acceleration device - Virtual Function";
}
enum crypto-pf {
description
"Crypto acceleration device - Physical Function";
}
enum unknown {
description
"Unknow device type";
}
}
}
feature dns-udp-tcp-port {
description
"Indicates that the device supports the configuration of
the UDP and TCP port for DNS servers.
This is a 'feature', since many implementations do not support
any port other than the default port.";
}
grouping pci-address-grouping {
description
"Group of PCI addresses attributes.";
leaf domain {
type string {
length "4";
}
description
"PCI address domain.";
}
leaf bus {
type string {
length "2";
}
description
"PCI address bus.";
}
leaf slot {
type string {
length "2";
}
description
"PCI address slot.";
}
leaf function {
type string {
length "2";
}
description
"PCI address function.";
}
}
typedef aaa-server-type {
type enumeration {
enum radius {
description
"Radius authentication server.";
}
enum ldap {
description
"LDAP authentication server.";
}
}
description
"AAA server types.";
}
rpc system-devices-list {
description
"List of the usefull PCI devices in the system.";
output {
list devices {
container pci-address {
uses pci-address-grouping;
description
"PCI address device/bus/slot/function.";
}
leaf device-type {
type system-device-type-t;
description
"PCI device type.";
}
leaf device-driver {
type string;
description
"PCI device driver.";
}
leaf host-device-name {
type string;
description
"PCI network device name.";
}
leaf host-device-state {
type string;
description
"PCI network device state.";
}
}
}
}
rpc system-reboot {
input {
leaf minutes {
type uint16;
description
"Time in minutes to reboot.";
}
leaf cancel {
type boolean;
description
"Cancel the reboot";
}
}
}
rpc system-ping {
input {
leaf destination {
type union {
type inet:domain-name;
type inet:ip-address-no-zone;
}
mandatory true;
description
"Destination being pinged.";
}
leaf interface {
type ngcom:if-identifier-63;
description
"Interface source";
}
leaf source {
type inet:ip-address-no-zone;
description
"IP address source";
}
leaf count {
type uint32;
description
"Number of ECHO requests";
}
leaf interval {
type decimal64 {
fraction-digits 6;
range "0.000001..6000";
}
description
"interval between pings
in seconds";
}
leaf ipv4-only {
type boolean;
description
"Only use IPv4 addressing.";
}
leaf ipv6-only {
type boolean;
description
"Only use IPv6 addressing.";
}
leaf packet-size {
type uint32;
description
"Ping packet (data) size";
}
leaf ttl {
type uint8;
description
"Time to live";
}
leaf timeout {
type uint32;
description
"Absolute wait time.";
}
leaf namespace {
type ngcom:network-namespace;
description
"Network namespace.";
}
}
output {
leaf stdout {
type string;
}
}
}
rpc system-traceroute {
input {
leaf destination {
type union {
type inet:domain-name;
type inet:ip-address-no-zone;
}
mandatory true;
description
"Destination being pinged.";
}
leaf interface {
type ngcom:if-identifier-63;
description
"Interface source";
}
leaf source {
type inet:ip-address-no-zone;
description
"IP address source";
}
leaf ipv4-only {
type boolean;
description
"Only use IPv4 addressing.";
}
leaf ipv6-only {
type boolean;
description
"Only use IPv6 addressing.";
}
leaf packet-size {
type uint32;
description
"Ping packet (data) size";
}
leaf ttl {
type uint8;
description
"Time to live";
}
leaf no-dns {
type boolean;
description
"Do not perform name lookup.";
}
leaf wait-time {
type uint32;
description
"Probe response wait time.";
}
leaf namespace {
type ngcom:network-namespace;
description
"Network namespace.";
}
}
output {
leaf stdout {
type string;
}
}
}
rpc system-nft {
input {
leaf command {
type string;
description
"Netfilter utility command";
}
leaf timeout {
type uint32;
description
"Timeout for response";
}
}
output {
leaf stdout {
type string;
}
}
}
container system {
description
"System group configuration.";
ngcliext:parent-fmt "$%";
leaf description {
type ngcom:description-63;
description
"A textual description of the entity. This value should
include the full name and version identification of the
system's hardware type, software operating-system, and
networking software. It is mandatory that this only contain
printable ASCII characters.";
ngcliext:node-fmt "$< $% @@$n";
}
leaf contact {
type ngcom:description-63;
description
"The administrator contact information for the system.
A server implementation MAY map this leaf to the sysContact
MIB object. Such an implementation needs to use some
mechanism to handle the differences in size and characters
allowed between this leaf and sysContact. The definition of
such a mechanism is outside the scope of this document.";
reference
"RFC 3418: Management Information Base (MIB) for the
Simple Network Management Protocol (SNMP)
SNMPv2-MIB.sysContact";
ngcliext:node-fmt "$< $% @@$n";
}
leaf name {
type inet:domain-name;
description
"The name of the host. This name can be a single domain
label or the fully qualified domain name of the host.";
ngcliext:node-fmt "$< $% @@$n";
}
leaf location {
type ngcom:string-xml-no-escape {
length 1..127;
}
description
"The system location.
A server implementation MAY map this leaf to the sysLocation
MIB object. Such an implementation needs to use some
mechanism to handle the differences in size and characters
allowed between this leaf and sysLocation. The definition
of such a mechanism is outside the scope of this document.";
reference
"RFC 3418: Management Information Base (MIB) for the
Simple Network Management Protocol (SNMP)
SNMPv2-MIB.sysLocation";
ngcliext:node-fmt "$< $% @@$n";
}
list dns-resolver {
key namespace;
description
"Configuration of the DNS resolver.";
reference
"RFC 7317: A YANG Data Model for System Management";
ngcliext:node-fmt "$< $% @{namespace}$n";
ngcliext:pre-children-op "push";
leaf namespace {
type ngcom:network-namespace;
description
"Network namespace to be used.";
}
leaf-list search {
type inet:domain-name;
ordered-by user;
description
"An ordered list of domains to search when resolving
a host name.";
ngcliext:node-fmt "^$% @@$n";
}
list server {
key name;
ordered-by user;
ngcliext:parent-fmt "^$% @{name}";
description
"List of the DNS servers that the resolver should query.
When the resolver is invoked by a calling application, it
sends the query to the first name server in this list. If
no response has been received within 'timeout' seconds,
the resolver continues with the next server in the list.
If no response is received from any server, the resolver
continues with the first server again. When the resolver
has traversed the list 'attempts' times without receiving
any response, it gives up and returns an error to the
calling application.
Implementations MAY limit the number of entries in this
list.";
leaf name {
type union {
type ngcom:identifier-31;
type inet:ip-address-no-zone;
}
description
"An arbitrary name for the DNS server.";
}
choice transport {
mandatory true;
description
"The transport-protocol-specific parameters for this
server.";
ngcliext:parent-fmt "$<";
case udp-and-tcp {
container udp-and-tcp {
description
"Contains UDP- and TCP-specific configuration
parameters for DNS.";
reference
"RFC 1035: Domain Names - Implementation and
Specification
RFC 5966: DNS Transport over TCP -
Implementation Requirements";
ngcliext:parent-fmt "$<";
leaf address {
type inet:ip-address;
mandatory true;
description
"The address of the DNS server.";
ngcliext:node-fmt "$< @@%{port-number}$n";
}
leaf port {
if-feature dns-udp-tcp-port;
type inet:port-number;
default 53;
description
"The UDP and TCP port number of the
DNS server.";
ngcliext:sibling-fmt " @@";
}
}
}
}
}
}
leaf login-banner {
type string {
length 1..4096;
}
description
"A banner message to be displayed at user login, as part
of update-motd.";
ngcliext:node-fmt "$< banner .$n@@.$n";
}
container kernel {
ngcliext:context "system-kernel";
ngcliext:parent-fmt "system $%";
container arguments {
description
"Linux kernel arguments";
ngcliext:parent-fmt "$< $%";
choice config-type {
ngcliext:parent-fmt "$<";
case auto {
container auto {
ngcliext:parent-fmt "$< $%";
leaf isolcpus {
type boolean;
description
"Enable or disable isolcpus";
ngcliext:node-op "bool";
ngcliext:node-fmt "|$< $%$n";
}
}
}
case manual {
leaf manual {
type string {
pattern '[a-zA-Z0-9_\-=.,\/ ]+';
}
description
"String to be added to kernel command line";
ngcliext:node-fmt "$< $% @@$n";
}
}
}
}
}
container auth {
ngcliext:parent-fmt "$%";
list user {
key "user-name";
description
"allowed users of the system";
ngcliext:node-fmt "$< $% @{user-name}$n";
ngcliext:pre-children-op "push";
leaf user-name {
type string {
pattern '[a-zA-Z0-9_]([-a-zA-Z0-9_]){1,31}';
}
description
"user name identifying user";
}
leaf user-password {
type ngcom:string-xml-no-escape {
length 6..256;
}
description
"The hash of the users password.";
ngcliext:node-fmt "^password @@$n";
}
list user-keys {
key "key-name";
description
"A list of user's public keys.";
ngcliext:node-fmt "^$% @{key-name}$n";
leaf key-name {
type ngcom:identifier-31;
description
"A unique identifier for this key.";
}
leaf key-data {
type string {
length 1..5000;
}
description
"ASCII encoded data for user key.";
ngcliext:node-fmt "@@$n$n";
}
}
}
container server-groups {
description
"Server groups to use for authentication methods.";
ngcliext:parent-fmt "$<";
list server-group {
key "name";
max-elements 5;
ngcliext:node-fmt "$< $% @{name}$n";
ngcliext:pre-children-op "push";
leaf name {
type string {
length "1..16";
pattern '[a-zA-Z0-9_]([-a-zA-Z0-9_]){0,15}';
}
description
"Server group name.";
}
leaf type {
type aaa-server-type;
mandatory true;
description
"Type of AAA server.";
ngcliext:node-fmt "^$% @@$n";
}
container servers {
description
"Servers in this group.";
choice server-list-type {
mandatory true;
case subset {
list server {
key "priority";
description
"Configured auth server of the type used by this group.";
unique radius-server;
unique ldap-server;
max-elements 5;
must "radius-server or ldap-server" {
error-message "A server in a server-group must contain an available radius or ldap server";
}
ngcliext:node-fmt "^priority @{priority}";
leaf priority {
type uint8 {
range "1..255";
}
description
"Server priority (lowest to highest).";
}
leaf radius-server {
when "../../../type = 'radius'";
type leafref {
path "/ngradius:radius-client/ngradius:client/ngradius:servers/ngradius:name";
}
description
"Radius server name.";
ngcliext:node-fmt " radius @@$n";
}
leaf ldap-server {
when "../../../type = 'ldap'";
type leafref {
path "/ngldap:ldap-client/ngldap:client/ngldap:servers/ngldap:name";
}
description
"LDAP server name.";
ngcliext:node-fmt " ldap @@$n";
}
}
}
case all {
leaf all-servers {
type empty;
description
"All configured servers for the auth type used by this group.";
ngcliext:node-fmt "^$%$n";
}
}
}
}
}
}
container authentication-methods {
ngcliext:parent-fmt "$< method";
container radius {
description
"Radius server-group to use.";
ngcliext:pre-child-fmt "$< $%";
ngcliext:post-child-fmt "$n";
leaf server-group {
type leafref {
path "/ngsys:system/auth/server-groups/server-group/name";
}
must "/ngsys:system/ngsys:auth/ngsys:server-groups/ngsys:server-group[ngsys:name=current()]/ngsys:type = 'radius'" {
error-message "System authentication Radius server group must have type 'radius'";
}
ngcliext:node-fmt " $% @@";
}
}
container ldap {
description
"LDAP server-group to use.";
ngcliext:pre-child-fmt "$< $%";
ngcliext:post-child-fmt "$n";
leaf server-group {
type leafref {
path "/ngsys:system/auth/server-groups/server-group/name";
}
must "/ngsys:system/ngsys:auth/ngsys:server-groups/ngsys:server-group[ngsys:name=current()]/ngsys:type = 'ldap'" {
error-message "System authentication LDAP server group must have type 'ldap'";
}
ngcliext:node-fmt " $% @@";
}
}
}
}
}
container system-state {
config false;
description
"System group operational state.";
leaf object-id {
type string;
config false;
description
"The vendor's authoritative identification of the network
management subsystem contained in the entity. This value
is allocated within the SMI enterprises subtree (1.3.6.1.4.1)
and provides an easy and unambiguous means for determining
`what kind of box' is being managed. For example, if vendor
`Flintstones, Inc.' was assigned the subtree 1.3.6.1.4.1.4242,
it could assign the identifier 1.3.6.1.4.1.4242.1.1 to its
`Fred Router'.";
}
leaf uptime {
type uint64;
description
"The time (in hundredths of a second) since the network
management portion of the system was last re-initialized.";
}
leaf total-ram {
type uint64;
description
"Total usable main memory size.";
}
leaf free-ram {
type uint64;
description
"Available memory size.";
}
leaf shared-ram {
type uint64;
description
"Shared memory size.";
}
leaf buffer-ram {
type uint64;
description
"Memory used by buffers.";
}
leaf total-swap {
type uint64;
description
"Total swap space allocated for this host.";
}
leaf free-swap {
type uint64;
description
"Free swap space for this host.";
}
container product {
description
"Product specific information.";
leaf product-vendor {
type string;
description
"product vendor name.";
}
leaf product-name {
type string;
description
"product name.";
}
leaf product-model {
type string;
description
"product model.";
}
leaf product-version {
type string;
description
"product version.";
}
leaf product-serial {
type string;
description
"product serial number.";
}
}
container platform {
description
"Contains vendor-specific information for
identifying the system platform and operating system.";
reference
"IEEE Std 1003.1-2008 - sys/utsname.h";
leaf os-name {
type string;
description
"The name of the operating system in use -
for example, 'Linux'.";
reference
"IEEE Std 1003.1-2008 - utsname.sysname";
}
leaf os-release {
type string;
description
"The current release level of the operating
system in use. This string MAY indicate
the OS source code revision.";
reference
"IEEE Std 1003.1-2008 - utsname.release";
}
leaf os-version {
type string;
description
"The current version level of the operating
system in use. This string MAY indicate
the specific OS build date and target variant
information.";
reference
"IEEE Std 1003.1-2008 - utsname.version";
}
leaf machine {
type string;
description
"A vendor-specific identifier string representing
the hardware in use.";
reference
"IEEE Std 1003.1-2008 - utsname.machine";
}
}
}
}