-
Notifications
You must be signed in to change notification settings - Fork 2
871 lines (838 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
860
861
862
863
864
865
866
867
868
869
870
871
module ietf-dhcpv6-server {
namespace "urn:ietf:params:xml:ns:yang:ietf-dhcpv6-server";
prefix "dhcpv6-server";
import ietf-inet-types {
prefix inet;
revision-date "2013-07-15";
}
import ietf-yang-types {
prefix yang;
revision-date "2013-07-15";
}
import ietf-dhcpv6-options {
prefix dhcpv6-options;
revision-date "2017-11-24";
}
organization "DHC WG";
contact "[email protected]
description "This model defines a YANG data model that can be
used to configure and manage a DHCPv6 server.";
revision 2017-11-29 {
description "First version of separation of server configuration
and state trees.";
reference "I-D: draft-ietf-dhc-dhcpv6-yang";
}
revision 2017-11-24 {
description "First version of the separated server specific
YANG model.";
reference "I-D: draft-ietf-dhc-dhcpv6-yang";
}
/*
* Typedef
*/
typedef threshold {
type union {
type uint16 {
range 0..100;
}
type enumeration {
enum "disabled" {
description "No threshold";
}
}
}
description "Threshold value in percent";
}
/*
* Grouping
*/
grouping vendor-infor {
description "Vendor information.";
container vendor-info {
description "";
leaf ent-num {
type uint32;
mandatory true;
description "enterprise number";
}
leaf-list data {
type string;
description "specific vendor info";
}
}
}
grouping duid {
description "DHCP Unique Identifier";
reference "RFC3315: Section 9";
choice duid-type {
description "Selects the format for the DUID.";
case duid-llt {
description "DUID Based on Link-layer Address Plus Time";
reference "RFC3315 Section 9.2";
leaf duid-llt-hardware-type {
type uint16;
description "Hardware type as assigned by IANA (RFC826).";
}
leaf duid-llt-time {
type yang:timeticks;
description "The time value is the time that the DUID is generated
represented in seconds since midnight (UTC), January 1, 2000,
modulo 2^32.";
}
leaf duid-llt-link-layer-addr {
type yang:mac-address;
description "Link-layer address as described in RFC2464";
}
}
case duid-en {
description "DUID Assigned by Vendor Based on Enterprise Number";
reference "RFC3315 Section 9.3";
leaf duid-en-enterprise-number {
type uint32;
description "Vendor's registered Private Enterprise Number as
maintained by IANA";
}
leaf duid-en-identifier {
type string;
description "Indentifier, unique to the device that is using it";
}
}
case duid-ll {
description "DUID Based on Link-layer Address";
reference "RFC3315 Section 9.4";
leaf duid-ll-hardware-type {
type uint16;
description "Hardware type as assigned by IANA (RFC826).";
}
leaf duid-ll-time {
type yang:timeticks;
description "The time value is the time that the DUID is generated
represented in seconds since midnight (UTC), January 1, 2000,
modulo 2^32.";
}
}
}
}
/*
* Data Nodes
*/
container server {
description "dhcpv6 server portion";
/*configuration data*/
container server-config{
description "configuration tree of server";
container serv-attributes {
description "This container contains basic attributes
of a DHCPv6 server such as DUID, server name and so
on. Some optional functions that can be provided by
the server is also included.";
leaf name {
type string;
description "server's name";
}
container duid {
description "Sets the DUID";
uses duid;
}
leaf-list ipv6-address {
type inet:ipv6-address;
description "Server's IPv6 address.";
}
leaf description {
type string;
description "Description of the server.";
}
leaf pd-function {
type boolean;
mandatory true;
description "Whether the server can act as a
delegating router to perform prefix delegation
([RFC3633]).";
}
leaf stateless-service {
type boolean;
mandatory true;
description "A boolean value specifies whether
the server support client-server exchanges
involving two messages defined in ([RFC3315]).";
}
leaf rapid-commit {
type boolean;
mandatory true;
description "A boolean value specifies whether
the server support client-server exchanges
involving two messages defined in ([RFC3315]).";
}
leaf-list interfaces-config {
// Note - this should probably be references to
// entries in the ietf-interfaces model
type string;
description "A leaf list to denote which one or
more interfaces the server should listen on. The
default value is to listen on all the interfaces.
This node is also used to set a unicast address
for the server to listen with a specific interface.
For example, if people want the server to listen
on a unicast address with a specific interface, he
can use the format like 'eth1/2001:db8::1'.";
}
uses vendor-infor;
}
container option-sets {
list option-set {
key id;
leaf id {
type uint32;
}
uses dhcpv6-options:server-option-definitions;
uses dhcpv6-options:custom-option-definitions;
}
}
container network-ranges {
description "This model supports a hierarchy
to achieve dynamic configuration. That is to
say we could configure the server at different
levels through this model. The top level is a
global level which is defined as the container
'network-ranges'. The following levels are
defined as sub-containers under it. The
'network-ranges' contains the parameters
(e.g. option-sets) that would be allocated to
all the clients served by this server.";
list network-range {
key network-range-id;
description "Under the 'network-ranges'
container, a 'network-range' list is
defined to configure the server at a
network level which is also considered
as the second level. Different network
are identified by the key 'network-range-id'.
This is because a server may have different
configuration parameters (e.g. option sets)
for different networks.";
leaf network-range-id {
type uint32;
mandatory true;
description "equivalent to subnet id";
}
leaf network-description {
type string;
mandatory true;
description "description of the subnet";
}
leaf network-prefix {
type inet:ipv6-prefix;
mandatory true;
description "subnet prefix";
}
leaf inherit-option-set {
type boolean;
mandatory true;
description "indicate whether to inherit
the configuration from higher level";
}
leaf option-set-id {
type leafref {
path "/server/server-config/option-sets/option-set/id";
}
description "The ID field of relevant option-set to be
provisioned to clients of this network-range.";
}
}
container reserved-addresses {
description "reserved addresses";
list static-binding {
key cli-id;
description "static binding of
reserved addresses";
leaf cli-id {
type uint32;
mandatory true;
description "client id";
}
container duid {
description "Sets the DUID";
uses duid;
}
leaf-list reserv-addr {
type inet:ipv6-address;
description "reserved addr";
}
}
leaf-list other-reserv-addr {
type inet:ipv6-address;
description "other reserved
addr";
}
}
container reserved-prefixes {
description "reserved prefixes";
list static-binding {
key cli-id;
description "static binding";
leaf cli-id {
type uint32;
mandatory true;
description "client id";
}
container duid {
description "Sets the DUID";
uses duid;
}
leaf reserv-prefix-len {
type uint8;
mandatory true;
description "reserved
prefix length";
}
leaf reserv-prefix {
type inet:ipv6-prefix;
mandatory true;
description
"reserved prefix";
}
}
leaf exclude-prefix-len {
type uint8;
mandatory true;
description "exclude prefix
length";
}
leaf exclude-prefix {
type inet:ipv6-prefix;
mandatory true;
description "exclude prefix";
}
list other-reserv-prefix {
key reserv-id;
description
"other reserved prefix";
leaf reserv-id {
type uint32;
mandatory true;
description
"reserved prefix id";
}
leaf prefix-len {
type uint8;
mandatory true;
description "prefix length";
}
leaf prefix {
type inet:ipv6-prefix;
mandatory true;
description
"reserved prefix";
}
}
}
container address-pools {
description "A container describes
the DHCPv6 server's address pools.";
list address-pool {
key pool-id;
description "A DHCPv6 server can
be configured with several address
pools. This list defines such
address pools which are distinguish
by the key called 'pool-name'.";
leaf pool-id {
type uint32;
mandatory true;
description "pool id";
}
leaf pool-prefix {
type inet:ipv6-prefix;
mandatory true;
description "pool prefix";
}
leaf start-address {
type inet:ipv6-address-no-zone;
mandatory true;
description "start address";
}
leaf end-address {
type inet:ipv6-address-no-zone;
mandatory true;
description "end address";
}
leaf renew-time {
type yang:timeticks;
mandatory true;
description "renew time";
}
leaf rebind-time {
type yang:timeticks;
mandatory true;
description "rebind time";
}
leaf preferred-lifetime {
type yang:timeticks;
mandatory true;
description "preferred lifetime
for IA";
}
leaf valid-lifetime {
type yang:timeticks;
mandatory true;
description "valid liftime for IA";
}
leaf utilization-ratio {
type threshold;
mandatory true;
description "the utilization ratio";
}
leaf inherit-option-set {
type boolean;
mandatory true;
description "indicate whether to
inherit the configuration from
higher level";
}
leaf option-set-id {
type leafref {
path "/server/server-config/option-sets/option-set/id";
}
mandatory true;
description "The ID field of relevant option-set to be
provisioned to clients of this address-pool.";
}
}
}
container prefix-pools {
description "If a server supports prefix
delegation function, this container will
be used to define the delegating router's
refix pools.";
list prefix-pool {
key pool-id;
description "Similar to server's
address pools, a delegating router
can also be configured with multiple
prefix pools specified by a list
called 'prefix-pool'.";
leaf pool-id {
type uint32;
mandatory true;
description "pool id";
}
leaf prefix {
type inet:ipv6-prefix;
mandatory true;
description "ipv6 prefix";
}
leaf prefix-length {
type uint8;
mandatory true;
description "prefix length";
}
leaf renew-time {
type yang:timeticks;
mandatory true;
description "renew time";
}
leaf rebind-time {
type yang:timeticks;
mandatory true;
description "rebind time";
}
leaf preferred-lifetime {
type yang:timeticks;
mandatory true;
description "preferred lifetime for
IA";
}
leaf valid-lifetime {
type yang:timeticks;
mandatory true;
description "valid lifetime for IA";
}
leaf utilization-ratio {
type threshold;
mandatory true;
description "utilization ratio";
}
leaf inherit-option-set {
type boolean;
mandatory true;
description "whether to inherit
configuration from higher level";
}
leaf option-set-id {
type leafref {
path "/server/server-config/option-sets/option-set/id";
}
description "The ID field of relevant option-set to be
provisioned to clients of this prefix-pool.";
}
}
}
container hosts {
description "hosts level";
list host {
key cli-id;
description "specific host";
leaf cli-id {
type uint32;
mandatory true;
description "client id";
}
container duid {
description "Sets the DUID";
uses duid;
}
leaf inherit-option-set {
type boolean;
mandatory true;
description "whether to inherit
configuration
from higher level";
}
leaf option-set-id {
type leafref {
path "/server/server-config/option-sets/option-set/id";
}
description "The ID field of relevant option-set to be
provisioned to clients of this prefix-pool.";
}
leaf nis-domain-name {
type string;
description "nis domain name";
}
leaf nis-plus-domain-name {
type string;
description "nisp domain name";
}
}
}
}
container relay-opaque-paras {
description "This container contains some
opaque values in Relay Agent options that
need to be configured on the server side
only for value match. Such Relay Agent
options include Interface-Id option,
Remote-Id option and Subscriber-Id option.";
list relays {
key relay-name;
description "relay agents";
leaf relay-name {
type string;
mandatory true;
description "relay agent name";
}
list interface-info {
key if-name;
description "interface info";
leaf if-name {
type string;
mandatory true;
description "interface name";
}
leaf interface-id {
type string;
mandatory true;
description "interface id";
}
}
list subscribers {
key subscriber;
description "subscribers";
leaf subscriber {
type uint32;
mandatory true;
description "subscriber";
}
leaf subscriber-id {
type string;
mandatory true;
description "subscriber id";
}
}
list remote-host {
key ent-num;
description "remote host";
leaf ent-num {
type uint32;
mandatory true;
description "enterprise number";
}
leaf remote-id {
type string;
mandatory true;
description "remote id";
}
}
}
}
container rsoo-enabled-options {
description "rsoo enabled options";
list rsoo-enabled-option{
key option-code;
description "rsoo enabled option";
leaf option-code {
type uint16;
mandatory true;
description "option code";
}
leaf description {
type string;
mandatory true;
description "description of the option";
}
}
}
}
/*State data*/
container server-state{
config "false";
description "states of server";
container network-ranges{
list network-range{
key network-range-id;
leaf network-range-id {
type uint32;
mandatory true;
description "equivalent to subnet id";
}
description "The ID field of relevant option-set to be
provisioned to clients of this network-range.";
container address-pools{
description "A container that describes
the DHCPv6 server's address pools";
list address-pool{
key pool-id;
leaf pool-id {
type uint32;
mandatory true;
description "pool id";
}
description "...";
leaf total-ipv6-count{
type uint64;
mandatory true;
description "how many ipv6 addresses
are in the pool";
}
leaf used-ipv6-count{
type uint64;
mandatory true;
description "how many are allocated";
}
leaf utilization-ratio{
type threshold;
mandatory true;
description "the utilization ratio";
}
}
list binding-info {
key cli-id;
description "A list that records a binding
information for each DHCPv6 client
that has already been allocated
IPv6 addresses.";
leaf cli-id{
type uint32;
mandatory true;
description "client id";
}
container duid {
description "Read the DUID";
uses duid;
}
list cli-ia{
key iaid;
description "client IA";
leaf ia-type{
type string;
mandatory true;
description "IA type";
}
leaf iaid{
type uint32;
mandatory true;
description "IAID";
}
leaf-list cli-addr{
type inet:ipv6-address;
description "client addr";
}
leaf pool-id{
type uint32;
mandatory true;
description "pool id";
}
}
}
}
container prefix-pools{
description "If a server supports prefix
delegation function, this container will
be used to define the delegating router's
prefix pools.";
list binding-info{
key cli-id;
description "A list records a binding
information for each DHCPv6 client
that has already been alloated IPv6
addresses.";
leaf cli-id{
type uint32;
mandatory true;
description "client id";
}
container duid{
description "Reads the DUID";
uses duid;
}
list cli-iapd{
key iaid;
description "client IAPD";
leaf iaid{
type uint32;
mandatory true;
description "IAID";
}
leaf-list cli-prefix {
type inet:ipv6-prefix;
description "client ipv6 prefix";
}
leaf-list cli-prefix-len{
type uint8;
description "client prefix length";
}
leaf pool-id{
type uint32;
mandatory true;
description "pool id";
}
}
}
}
}
}
container packet-stats {
description "A container presents
the packet statistics related to
the DHCPv6 server.";
leaf solicit-count {
type uint32;
mandatory true;
description "solicit counter";
}
leaf request-count {
type uint32;
mandatory true;
description "request counter";
}
leaf renew-count {
type uint32;
mandatory true;
description "renew counter";
}
leaf rebind-count {
type uint32;
mandatory true;
description "rebind counter";
}
leaf decline-count {
type uint32;
mandatory true;
description "decline count";
}
leaf release-count {
type uint32;
mandatory true;
description "release counter";
}
leaf info-req-count {
type uint32;
mandatory true;
description "information request
counter";
}
leaf advertise-count {
type uint32;
mandatory true;
description "advertise counter";
}
leaf confirm-count {
type uint32;
mandatory true;
description "confirm counter";
}
leaf reply-count {
type uint32;
mandatory true;
description "reply counter";
}
leaf reconfigure-count {
type uint32;
mandatory true;
description "reconfigure counter";
}
leaf relay-forward-count {
type uint32;
mandatory true;
description "relay forward counter";
}
leaf relay-reply-count {
type uint32;
mandatory true;
description "relay reply counter";
}
}
}
}
/*
* Notifications
*/
notification notifications {
description "dhcpv6 notification module";
container dhcpv6-server-event {
description "dhcpv6 server event";
container pool-running-out {
description "raised when the address/prefix pool is going to
run out. A threshold for utilization ratio of the pool has
been defined in the server feature so that it will notify the
administrator when the utilization ratio reaches the
threshold, and such threshold is a settable parameter";
leaf utilization-ratio {
type uint16;
mandatory true;
description "utilization ratio";
}
container duid {
description "Sets the DUID";
uses duid;
}
leaf serv-name {
type string;
description "server name";
}
leaf pool-name {
type string;
mandatory true;
description "pool name";
}
}
container invalid-client-detected {
description "raised when the server has found a client which
can be regarded as a potential attacker. Some description
could also be included.";
container duid {
description "Sets the DUID";
uses duid;
}
leaf description {
type string;
description "description of the event";
}
}
}
}
}