summaryrefslogtreecommitdiffstats
path: root/src/share/yang/modules/kea-dhcp4-server@2023-06-28.yang
blob: c2561057e898534a4b2d774d964d18645401ecd8 (plain)
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
module kea-dhcp4-server {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:kea-dhcp4-server";
  prefix "kea-dhcp4-server";

  import ietf-inet-types {
    prefix inet;
  }
  import kea-types {
    prefix kea;
    revision-date 2019-08-12;
  }
  import kea-dhcp-types {
    prefix dhcp;
    revision-date 2023-06-28;
  }

  organization "Internet Systems Consortium";
  contact "kea-dev@lists.isc.org";
  description "This model defines a YANG data model that can be
               used to configure and manage a Kea DHCPv4 server.";

  revision 2023-06-28 {
    description "Added pool ID.";
  }

  revision 2023-05-31 {
    description "Added allocator, ddns-ttl-percent, exclude-first-last-24,
                 ignore-dhcp-server-identifier, offer-lifetime,
                 read-timeout, tcp-user-timeout, write-timeout.
                 Removed contact-points, keyspace.";
  }

  revision 2022-12-27 {
    description "Added never-send to option-data.";
  }

  revision 2022-11-30 {
    description "Added the template-test node for client classes.";
  }

  revision 2022-07-27 {
    description "Added TLS parameters for database connections: trust-anchor,
                 cert-file, key-file, cipher-list. Added parameters which govern
                 the way the server behaves regarding detection of configured
                 interfaces: service-sockets-require-all,
                 service-sockets-max-retries, service-sockets-retry-wait-time.
                 Added parameters which govern reservations lookup:
                 early-global-reservations-lookup, reservations-lookup-first.";
  }

  revision 2021-11-24 {
    description "Fixed store-extended-info. Added several containers and leaves:
                 compatibility, lenient-option-parsing, multi-threading,
                 enable-multi-threading, packet-queue-size, thread-pool-size,
                 valid-lifetime, min-valid-lifetime, max-valid-lifetime,
                 preferred-lifetime, min-preferred-lifetime,
                 max-preferred-lifetime, cache-max-age, cache-threshold,
                 ddns-generated-prefix, ddns-override-client-update,
                 ddns-override-no-update, ddns-qualifying-suffix,
                 ddns-replace-client-name, ddns-send-updates,
                 ddns-update-on-renew, ddns-use-conflict-resolution,
                 ip-reservations-unique, parked-packet-limit,
                 reservations-global, reservations-in-subnet,
                 reservations-out-of-pool, statistic-default-sample-age,
                 statistic-default-sample-count, store-extended-info, on-fail.";
  }

  revision 2021-08-25 {
    description "Added store-extended-info";
  }

  revision 2019-08-12 {
    description "Initial revision";
  }

  /*
  * Typedefs
  */
  typedef host-identifier-type {
    type enumeration {
      enum "duid" {
        description "DUID";
      }
      enum "hw-address" {
        description "Hardware address";
      }
      enum "circuit-id" {
        description "Circuit-id option";
      }
      enum "client-id" {
        description "Client identifier";
      }
      enum "flex-id" {
        description "Flexible identifier";
      }
    }
    description "Host identifier type.";
  }

  /*
  * Groupings
  */
  grouping match-client-id {
    description "Match client ID grouping.";
    leaf match-client-id {
      type boolean;
      description "Use client-id for lease lookups. If set to false, client-id
                   will be ignored.";
    }
  }

  grouping next-server {
    description "Next server address grouping.";
    leaf next-server {
      type inet:ipv4-address;
      description "Next server IPv4 address. If set, this value will be set
                   in siaddr field.";
    }
  }

  grouping server-hostname {
    description "Server hostname grouping.";
    leaf server-hostname {
      type string;
      description "Server hostname (up to 64 bytes).";
    }
  }

  grouping boot-file-name {
    description "Boot file name grouping.";
    leaf boot-file-name {
      type string;
      description "Boot file name (up to 128 bytes).";
    }
  }

  grouping authoritative {
    description "Authoritative grouping.";
    leaf authoritative {
      type boolean;
      description "NAK requests for unknown clients. If set to false
                   ignore them.";
      }
  }

  grouping relay {
    description "Relay grouping.";
    leaf-list ip-addresses {
      type inet:ipv4-address;
      description "IPv4 addresses.";
    }
  }

  grouping host {
    description "Host grouping.";
    leaf identifier-type {
      type host-identifier-type;
      mandatory true;
      description "Host identifier type.";
    }
    uses dhcp:host-identifier;
    leaf ip-address {
      type inet:ipv4-address;
      description "Host reserved IPv4 address.";
    }
    uses dhcp:host-hostname;
    uses dhcp:host-client-classes;
    uses option-data-list;
    uses next-server;
    uses server-hostname;
    uses boot-file-name;
    uses dhcp:host-user-context;
  }

  grouping reservations {
    description "Host reservations grouping.";
    list host {
      key "identifier-type identifier";
      description "Host reservation list.";
      uses host;
    }
  }

  grouping subnet4-list {
    description "Subnet4 list grouping.";
    list subnet4 {
      key id;
      ordered-by user;
      description "List of IPv4 subnets.";
      uses dhcp:allocator;
      uses dhcp:offer-lifetime;
      uses dhcp:valid-lifetime;
      uses dhcp:min-valid-lifetime;
      uses dhcp:max-valid-lifetime;
      uses dhcp:renew-timer;
      uses dhcp:rebind-timer;
      uses dhcp:calculate-tee-times;
      uses dhcp:t1-percent;
      uses dhcp:t2-percent;
      uses option-data-list;
      list pool {
        key "start-address end-address";
        ordered-by user;
        description "Pool list.";
        leaf prefix {
          type inet:ipv4-prefix;
          description "Defines a pool of dynamic IPv4 addresses to be managed
                       by the server.";
        }
        leaf start-address {
          type inet:ipv4-address;
          mandatory true;
          description "First IPv4 address in a pool.";
        }
        leaf end-address {
          type inet:ipv4-address;
          mandatory true;
          description "Last IPv4 address in a pool.";
        }
        uses option-data-list;
        uses dhcp:pool-client-class;
        uses dhcp:pool-require-client-classes;
        uses dhcp:pool-id;
        uses dhcp:pool-user-context;
      }
      leaf subnet {
        type inet:ipv4-prefix;
        mandatory true;
        description "IPv4 subnet prefix.";
      }
      uses dhcp:subnet-interface;
      uses dhcp:subnet-id;
      uses dhcp:subnet-client-class;
      uses dhcp:subnet-require-client-classes;
      uses reservations {
        refine host {
          description "Subnet host reservations list.";
        }
      }
      uses dhcp:reservation-mode;
      container relay {
        description "Optional information about relay agent.";
        uses relay;
      }
      uses match-client-id;
      uses next-server;
      uses server-hostname;
      uses boot-file-name;
      leaf subnet-4o6-interface {
        type string;
        description "Subnet DHCPv4-over-DHCPv6 interface.";
      }
      leaf subnet-4o6-interface-id {
        type string;
        description "Subnet DHCPv4-over-DHCPv6 interface-id option.";
      }
      leaf subnet-4o6-subnet {
        type inet:ipv6-prefix;
        description "Subnet DHCPv4-over-DHCPv6 IPv6 prefix.";
      }
      uses authoritative;
      uses dhcp:cache-max-age;
      uses dhcp:cache-threshold;
      uses dhcp:ddns-generated-prefix;
      uses dhcp:ddns-override-client-update;
      uses dhcp:ddns-override-no-update;
      uses dhcp:ddns-qualifying-suffix;
      uses dhcp:ddns-replace-client-name;
      uses dhcp:ddns-send-updates;
      uses dhcp:ddns-ttl-percent;
      uses dhcp:ddns-update-on-renew;
      uses dhcp:ddns-use-conflict-resolution;
      uses dhcp:hostname-char-replacement;
      uses dhcp:hostname-char-set;
      uses dhcp:reservations-global;
      uses dhcp:reservations-in-subnet;
      uses dhcp:reservations-out-of-pool;
      uses dhcp:store-extended-info;
      uses dhcp:subnet-user-context;
    }
  }

  grouping client-classes {
    description "Client class grouping.";
    list client-class {
      key name;
      ordered-by user;
      description "List of client classes.";
      uses dhcp:class-name;
      uses dhcp:class-test;
      uses dhcp:template-test;
      uses dhcp:class-only-if-required;
      uses dhcp:offer-lifetime;
      uses option-def-list;
      uses option-data-list;
      uses next-server;
      uses server-hostname;
      uses boot-file-name;
      uses dhcp:valid-lifetime;
      uses dhcp:min-valid-lifetime;
      uses dhcp:max-valid-lifetime;
      uses dhcp:class-user-context;
    }
  }

  grouping option-def-list {
    description "Option definition list grouping.";
    list option-def {
      key "code space";
      description "Option definition entry.";
      leaf code {
        type uint8;
        mandatory true;
        description "Option code to be used by the new option definition.";
      }
      leaf space {
        type string;
        mandatory true;
        description "Option space for the new option (typically dhcp4).";
      }
      uses dhcp:option-def-name;
      uses dhcp:option-def-type;
      uses dhcp:option-def-record-types;
      uses dhcp:option-def-encapsulate;
      uses dhcp:option-def-array;
      uses dhcp:option-def-user-context;
     }
  }

  grouping option-data-list {
    description "Option data list grouping.";
    list option-data {
      key "code space";
      description "Option data entry.";
      leaf code {
        type uint8;
        mandatory true;
        description "Option code.";
      }
      leaf space {
        type string;
        mandatory true;
        description "Option space.";
      }
      uses dhcp:option-data-name;
      uses dhcp:option-data-data;
      uses dhcp:option-data-csv-format;
      uses dhcp:option-data-always-send;
      uses dhcp:option-data-never-send;
      uses dhcp:option-data-user-context;
    }
  }

  /*
  * Data Nodes
  */

  container config {
    // config true;
    description "Contains DHCPv4 server configuration.";

    uses dhcp:allocator;
    uses dhcp:offer-lifetime;
    uses dhcp:valid-lifetime;
    uses dhcp:min-valid-lifetime;
    uses dhcp:max-valid-lifetime;
    uses dhcp:renew-timer;
    uses dhcp:rebind-timer;
    uses dhcp:calculate-tee-times;
    uses dhcp:t1-percent;
    uses dhcp:t2-percent;
    uses dhcp:decline-probation-period;
    uses subnet4-list;

    list shared-network {
      key name;
      description "List of IPv4 shared networks.";
      uses dhcp:network-name;
      uses subnet4-list;
      uses dhcp:allocator;
      uses dhcp:offer-lifetime;
      uses dhcp:network-interface;
      uses dhcp:renew-timer;
      uses dhcp:rebind-timer;
      uses option-data-list;
      uses match-client-id;
      uses next-server;
      uses server-hostname;
      uses boot-file-name;
      container relay {
        description "Optional information about relay agent.";
        uses relay;
      }
      uses authoritative;
      uses dhcp:reservation-mode;
      uses dhcp:network-client-class;
      uses dhcp:network-require-client-classes;
      uses dhcp:valid-lifetime;
      uses dhcp:min-valid-lifetime;
      uses dhcp:max-valid-lifetime;
      uses dhcp:calculate-tee-times;
      uses dhcp:t1-percent;
      uses dhcp:t2-percent;
      uses dhcp:cache-max-age;
      uses dhcp:cache-threshold;
      uses dhcp:ddns-generated-prefix;
      uses dhcp:ddns-override-client-update;
      uses dhcp:ddns-override-no-update;
      uses dhcp:ddns-qualifying-suffix;
      uses dhcp:ddns-replace-client-name;
      uses dhcp:ddns-send-updates;
      uses dhcp:ddns-ttl-percent;
      uses dhcp:ddns-update-on-renew;
      uses dhcp:ddns-use-conflict-resolution;
      uses dhcp:hostname-char-replacement;
      uses dhcp:hostname-char-set;
      uses dhcp:reservations-global;
      uses dhcp:reservations-in-subnet;
      uses dhcp:reservations-out-of-pool;
      uses dhcp:store-extended-info;
      uses dhcp:network-user-context;
    }

    container interfaces-config {
      description "Network interfaces configuration.";
      leaf-list interfaces {
        type string;
        description "Name of the interface (e.g. eth0) or name/address
                     (e.g. eth0/192.168.1.1) or * (use all interfaces).";
      }
      leaf dhcp-socket-type {
        type enumeration {
          enum "raw" {
            description "DHCP service uses RAW sockets.";
          }
          enum "udp" {
            description "DHCP service uses UDP sockets.";
          }
        }
        description "Type of sockets to use.";
      }
      leaf outbound-interface {
        type enumeration {
          enum "same-as-inbound" {
            description "Send the response on the interface where the query
                         was received.";
          }
          enum "use-routing" {
            description "Use kernel routing.";
          }
        }
        description "Control the interface used to send a response.";
      }
      uses dhcp:interfaces-re-detect;
      uses dhcp:interfaces-service-sockets-require-all;
      uses dhcp:interfaces-service-sockets-max-retries;
      uses dhcp:interfaces-service-sockets-retry-wait-time;
      uses dhcp:interfaces-user-context;
    }

    uses dhcp:databases;

    leaf-list host-reservation-identifiers {
      type host-identifier-type;
      description "Host reservation identifiers.";
    }

    uses client-classes;
    uses option-def-list;
    uses option-data-list;
    uses kea:hooks-libraries;
    uses dhcp:expired-leases-processing;
    uses dhcp:dhcp4o6-port;
    uses kea:control-socket;
    uses dhcp:hostname-char-set;
    uses dhcp:hostname-char-replacement;
    uses dhcp:dhcp-ddns;

    leaf echo-client-id {
      type boolean;
      description "Send client-id back when the client sent it. This
                   is conformant with RFC6842, but some older, buggy
                   clients have problems with it.";
    }

    uses match-client-id;
    uses next-server;
    uses server-hostname;
    uses boot-file-name;
    uses authoritative;
    uses kea:user-context {
      refine user-context {
        description "DHCPv4 server user context. Arbitrary JSON data can
                     be stored here.";
      }
    }
    uses dhcp:sanity-checks;
    uses dhcp:reservation-mode;
    uses reservations {
      refine host {
        description "Global host reservations list.";
      }
    }
    uses dhcp:config-control;
    uses dhcp:server-tag;
    uses dhcp:dhcp-queue-control;
    uses kea:loggers;
    uses dhcp:cache-max-age;
    uses dhcp:cache-threshold;
    container compatibility {
      uses dhcp:common-compatibility;
      uses dhcp:v4-compatibility;
    }
    uses dhcp:ddns-generated-prefix;
    uses dhcp:ddns-override-client-update;
    uses dhcp:ddns-override-no-update;
    uses dhcp:ddns-qualifying-suffix;
    uses dhcp:ddns-replace-client-name;
    uses dhcp:ddns-send-updates;
    uses dhcp:ddns-ttl-percent;
    uses dhcp:ddns-update-on-renew;
    uses dhcp:ddns-use-conflict-resolution;
    uses dhcp:ip-reservations-unique;
    uses dhcp:early-global-reservations-lookup;
    uses dhcp:reservations-lookup-first;
    uses dhcp:multi-threading;
    uses dhcp:parked-packet-limit;
    uses dhcp:reservations-global;
    uses dhcp:reservations-in-subnet;
    uses dhcp:reservations-out-of-pool;
    uses dhcp:statistic-default-sample-age;
    uses dhcp:statistic-default-sample-count;
    uses dhcp:store-extended-info;
  }

  /*
  * State data
  */
  container state {
    config false;
    description "State of Kea DHCPv4 server.";

    container leases {
      description "Kea DHCPv4 leases.";
      list lease {
        key ip-address;
        description "List of Kea DHCPv4 leases.";
        leaf ip-address {
          type inet:ipv4-address;
          mandatory true;
          description "Lease IP address.";
        }
        leaf hw-address {
          type binary;
          mandatory true;
          description "Lease hardware address.";
        }
        leaf client-id {
          type binary;
          description "Lease client-id.";
        }
        uses dhcp:valid-lifetime {
          refine valid-lifetime {
            mandatory true;
          }
        }
        leaf cltt {
          type uint32;
          units "seconds";
          mandatory true;
          description "Lease client last transmission time.";
        }
        leaf subnet-id {
          type uint32;
          mandatory true;
          description "Lease subnet ID.";
        }
        leaf fqdn-fwd {
          type boolean;
          description "Lease FQDN forward flag.";
        }
        leaf fqdn-rev {
          type boolean;
          description "Lease FQDN reverse lag.";
        }
        leaf hostname {
          type string;
          description "Lease hostname.";
        }
        leaf state {
          type dhcp:lease-state;
          description "Lease state.";
        }
        leaf user-context {
          type kea:user-context;
          description "Lease user context.";
        }
      }
    }

    container lease-stats {
      description "Lease statistics.";
      list subnet {
        key subnet-id;
        description "List of IPv4 subnets.";
        leaf subnet-id {
          type uint32;
          mandatory true;
          description "Subnet ID.";
        }
        leaf total-addresses {
          type uint32;
          mandatory true;
          description "Total addresses counter.";
        }
        leaf assigned-addresses {
          type uint32;
          mandatory true;
          description "Assigned addresses counter.";
        }
        leaf declined-addresses {
          type uint32;
          mandatory true;
          description "Declined addresses counter.";
        }
      }
    }

    container hosts {
      description "Kea DHCPv4 hosts.";
      list host {
        key "subnet-id identifier-type identifier";
        description "List of Kea DHCPv4 hosts.";
        uses host;
        uses dhcp:host-subnet-id;
        leaf auth-key {
          type string;
          description "Host authentication key (unused in DHCPv4).";
        }
      }
    }
  }
}