blob: c0a2637f6f217a342745badff332da800308de9d [file] [log] [blame]
Thomas Vachuska6655bee2017-08-24 16:12:59 -07001module openconfig-relay-agent {
2
3 yang-version "1";
4
5 // namespace
6 namespace "http://openconfig.net/yang/relay-agent";
7
8 prefix "oc-relay";
9
10 // import some basic types
11 import ietf-inet-types { prefix inet; }
12 import ietf-yang-types { prefix yang; }
13 import openconfig-interfaces { prefix oc-if; }
14 import openconfig-extensions { prefix oc-ext; }
15
16
17 // meta
18 organization "OpenConfig working group";
19
20 contact
21 "OpenConfig working group
22 www.openconfig.net";
23
24 description
25 "This module describes a model for configuration and operational
26 state related to relay agents typically used for DHCP and BOOTP
27 packets. The supports both DHCP and DHCPv6 and device-wide and
28 per-interface settings.";
29
30 oc-ext:openconfig-version "0.1.0";
31
32 revision "2016-05-16" {
33 description
34 "Initial public release";
35 reference "0.1.0";
36 }
37
38
39 // grouping statements
40
41 grouping agent-information-ipv4-common-config {
42 description
43 "Common configuration data for DHCP relay option";
44
45 leaf enable {
46 type boolean;
47 default false;
48 description
49 "Enable sending the DHCP option for Relay Agent information
50 -- option 82.";
51 reference
52 "RFC 3046 - DHCP Relay Agent Information Option";
53 }
54 }
55
56 grouping agent-information-ipv4-common-state {
57 description
58 "Common operational state data for DHCP relay option";
59
60 }
61
62 grouping agent-information-ipv4-global-top {
63 description
64 "Top-level grouping for agent information data at global level";
65
66 container agent-information-option {
67 description
68 "Top-level container for relay agent information option
69 data";
70
71 container config {
72 description
73 "Configuration data for the relay agent information
74 option";
75
76 uses agent-information-ipv4-common-config;
77 }
78
79 container state {
80
81 config false;
82
83 description
84 "Operational state data for agent information at global
85 level";
86
87 uses agent-information-ipv4-common-config;
88 uses agent-information-ipv4-common-state;
89 }
90 }
91 }
92
93 grouping agent-information-ipv4-interface-config {
94 description
95 "Configuration data for DCHP relay option on interfaces";
96
97 leaf circuit-id {
98 type string;
99 description
100 "Encodes an agent-local identifier of the circuit from which
101 a DHCP client-to-server packet was received. It is intended
102 for use by agents in relaying DHCP responses back to the
103 proper circuit. The circuit id is an opaque value";
104 reference
105 "RFC 3046 - DHCP Relay Agent Information Option";
106 }
107
108 leaf remote-id {
109 type string;
110 description
111 "Provides a mechanism to identify the remote host end of
112 the circuit. The remote-id should be thought of as an
113 opaque value, but must be globally unique.";
114 reference
115 "RFC 3046 - DHCP Relay Agent Information Option";
116 }
117 }
118
119 grouping agent-information-ipv4-interface-state {
120 description
121 "Operational state data for DHCP relay option on interfaces";
122
123 leaf sent-circuit-id {
124 type string;
125 description
126 "Reports the circuit-id sent by the system to the DHCP
127 server.";
128 }
129
130 leaf sent-remote-id {
131 type string;
132 description
133 "Reports the remote-id value sent by the system to the DHCP
134 server";
135 }
136 }
137
138 grouping agent-information-ipv4-interface-top {
139 description
140 "Top-level grouping for relay agent information option data";
141
142 container agent-information-option {
143 description
144 "Top-level container for relay agent information option
145 data";
146
147 container config {
148 description
149 "Configuration data for the relay agent information
150 option";
151
152 uses agent-information-ipv4-common-config;
153 uses agent-information-ipv4-interface-config;
154 }
155
156 container state {
157
158 config false;
159
160 description
161 "Operational state data ";
162
163 uses agent-information-ipv4-common-config;
164 uses agent-information-ipv4-interface-config;
165 uses agent-information-ipv4-common-state;
166 uses agent-information-ipv4-interface-state;
167 }
168 }
169 }
170
171 grouping agent-options-ipv6-common-config {
172 description
173 "Configuration data for DHCPv6 options";
174
175 leaf enable-interface-id {
176 type boolean;
177 default false;
178 description
179 "Enables DHCPv6 OPTION_INTERFACE_ID (18) to identify the
180 interface on which the client message was received.";
181 reference
182 "IETF RFC 3315 - Dynamic Host Configuration Protocol for
183 IPv6 (DHCPv6)";
184 }
185
186 leaf enable-remote-id {
187 type boolean;
188 default false;
189 description
190 "Sets DHCPv6 OPTION_REMOTE_ID (37). This option is the
191 DHCPv6 equivalent for the IPv4 (DHCPv4) Relay Agent Option's
192 Remote-ID suboption as specified in RFC 3046. The remote-id
193 field may be used to encode a user name, remote IP address,
194 interface/port identifier, etc.";
195 reference
196 "IETF RFC 4649 - Dynamic Host Configuration Protocol for
197 IPv6 (DHCPv6) Relay Agent Remote-ID Option";
198 }
199 }
200
201 grouping agent-options-ipv6-common-state {
202 description
203 "Operational state data for DHCPv6 options";
204 }
205
206 grouping agent-options-ipv6-interface-config {
207 description
208 "Configuration data for DHCPv6 options";
209
210 leaf interface-id {
211 type string;
212 description
213 "Sets DHCPv6 OPTION_INTERFACE_ID (18) to identify the
214 interface on which the client message was received.";
215 reference
216 "IETF RFC 3315 - Dynamic Host Configuration Protocol for
217 IPv6 (DHCPv6)";
218 }
219
220 leaf remote-id {
221 type string;
222 description
223 "Sets DHCPv6 OPTION_REMOTE_ID (37). This option is the
224 DHCPv6 equivalent for the IPv4 (DHCPv4) Relay Agent Option's
225 Remote-ID suboption as specified in RFC 3046. The remote-id
226 field may be used to encode a user name, remote IP address,
227 interface/port identifier, etc.";
228 reference
229 "IETF RFC 4649 - Dynamic Host Configuration Protocol for
230 IPv6 (DHCPv6) Relay Agent Remote-ID Option";
231 }
232 }
233
234 grouping agent-options-ipv6-interface-state {
235 description
236 "Operational state data for DHCPv6 options";
237
238 leaf sent-interface-id {
239 type string;
240 description
241 "Reflects the DHCPv6 OPTION_INTERFACE_ID (18) sent to the
242 server by the system.";
243 reference
244 "IETF RFC 3315 - Dynamic Host Configuration Protocol for
245 IPv6 (DHCPv6)";
246 }
247
248 leaf sent-remote-id {
249 type string;
250 description
251 "Reflects the DHCPv6 OPTION_REMOTE_ID (37) sent to the
252 server by the system.";
253 reference
254 "IETF RFC 4649 - Dynamic Host Configuration Protocol for
255 IPv6 (DHCPv6) Relay Agent Remote-ID Option";
256 }
257 }
258
259 grouping agent-options-ipv6-global-top {
260 description
261 "Top-level grouping for DHCPv6 options on interfaces";
262
263 container options {
264 description
265 "Top-level container for DHCPv6 agent options on interfaces";
266
267 container config {
268 description
269 "Configuration data ";
270
271 uses agent-options-ipv6-common-config;
272 }
273
274 container state {
275
276 config false;
277
278 description
279 "Operational state data for DHCPv6 agent option on an
280 interface";
281
282 uses agent-options-ipv6-common-config;
283 uses agent-options-ipv6-common-state;
284 }
285 }
286 }
287
288 grouping agent-options-ipv6-interface-top {
289 description
290 "Top-level grouping for DHCPv6 options on interfaces";
291
292 container options {
293 description
294 "Top-level container for DHCPv6 agent options on interfaces";
295
296 container config {
297 description
298 "Configuration data ";
299
300 uses agent-options-ipv6-common-config;
301 uses agent-options-ipv6-interface-config;
302 }
303
304 container state {
305
306 config false;
307
308 description
309 "Operational state data for DHCPv6 agent option on an
310 interface";
311
312 uses agent-options-ipv6-common-config;
313 uses agent-options-ipv6-interface-config;
314 uses agent-options-ipv6-common-state;
315 uses agent-options-ipv6-interface-state;
316 }
317 }
318 }
319
320 grouping relay-agent-common-config {
321 description
322 "Configuration data for global level relay agent options,
323 common across address families";
324
325 leaf enable-relay-agent {
326 type boolean;
327 default false;
328 description
329 "Enables DHCP/BOOTP relay agent on all interfaces";
330 }
331 }
332
333 grouping relay-agent-common-state {
334 description
335 "Operational state data for global level relay agent, common
336 across address families";
337 }
338
339 grouping relay-agent-ipv4-config {
340 description
341 "Configuration data for DHCPv4 relay agents";
342
343 uses relay-agent-common-config;
344 }
345
346 grouping relay-agent-ipv4-state {
347 description
348 "Configuration data for DHCPv4 relay agents";
349
350 uses relay-agent-common-state;
351 }
352
353
354 grouping relay-agent-ipv4-top {
355 description
356 "Top-level grouping for global relay agent data";
357
358 container dhcp {
359 description
360 "Top-level container for global relay agent data";
361
362 container config {
363 description
364 "Configuration data for global DHCPv4";
365
366 uses relay-agent-ipv4-config;
367 }
368
369 container state {
370
371 config false;
372
373 description
374 "Operational state data global DHCPv4";
375
376 uses relay-agent-ipv4-config;
377 uses relay-agent-ipv4-state;
378 }
379
380 uses agent-information-ipv4-global-top;
381 uses relay-agent-ipv4-interfaces-top;
382 }
383 }
384
385 grouping relay-agent-ipv6-config {
386 description
387 "Configuration data for DHCPv6 relay agents";
388
389 uses relay-agent-common-config;
390 }
391
392 grouping relay-agent-ipv6-state {
393 description
394 "Configuration data for DHCPv6 relay agents";
395
396 uses relay-agent-common-state;
397 }
398
399 grouping relay-agent-ipv6-top {
400 description
401 "Top-level grouping for global relay agent data";
402
403 container dhcpv6 {
404 description
405 "Top-level container for global relay agent data";
406
407 container config {
408 description
409 "Configuration data for global DHCPv6";
410
411 uses relay-agent-ipv6-config;
412 }
413
414 container state {
415
416 config false;
417
418 description
419 "Operational state data global DHCPv6";
420
421 uses relay-agent-ipv6-config;
422 uses relay-agent-ipv6-state;
423 }
424
425 uses agent-options-ipv6-global-top;
426 uses relay-agent-ipv6-interfaces-top;
427 }
428 }
429
430
431 grouping relay-agent-common-stats {
432 description
433 "Common DHCP / BOOTP message statistics for
434 DHCPv4 and DHCPv6";
435
436
437 leaf total-dropped {
438 type yang:counter64;
439 description
440 "Total number of DHCP packets dropped by the relay agent";
441 }
442
443 leaf invalid-opcode {
444 type yang:counter64;
445 description
446 "Number of DHCP packets dropped due to an invalid opcode";
447 }
448
449 leaf invalid-options {
450 type yang:counter64;
451 description
452 "Number of DHCP packets dropped due to an invalid option";
453 }
454 }
455
456 grouping relay-agent-ipv4-stats {
457 description
458 "DHCPv4 relay agent message statistics";
459
460 leaf bootrequest-received {
461 type yang:counter64;
462 description
463 "BOOTREQUEST messages received by the relay agent";
464 }
465
466 leaf dhcp-decline-received {
467 type yang:counter64;
468 description
469 "DHCP DECLINE messages received by the relay agent";
470 }
471
472 leaf dhcp-discover-received {
473 type yang:counter64;
474 description
475 "DHCP DISCOVER messages received by the relay agent";
476 }
477
478 leaf dhcp-inform-received {
479 type yang:counter64;
480 description
481 "DHCP INFORM messages received by the relay agent";
482 }
483
484 leaf dhcp-release-received {
485 type yang:counter64;
486 description
487 "DHCP RELEASE messages received by the relay agent";
488 }
489
490 leaf dhcp-request-received {
491 type yang:counter64;
492 description
493 "DHCP REQUEST messages received by the relay agent";
494 }
495
496 leaf bootrequest-sent {
497 type yang:counter64;
498 description
499 "BOOTREQUEST messages forwarded by the relay agent";
500 }
501
502 leaf bootreply-sent {
503 type yang:counter64;
504 description
505 "BOOTREPLY messages forwarded by the relay agent";
506 }
507
508 leaf dhcp-offer-sent {
509 type yang:counter64;
510 description
511 "DHCP OFFER messages sent by the relay agent";
512 }
513
514 leaf dhcp-ack-sent {
515 type yang:counter64;
516 description
517 "DHCP ACK messages sent by the relay agent";
518 }
519
520 leaf dhcp-nack-sent {
521 type yang:counter64;
522 description
523 "DHCP NACK messages sent by the relay agent";
524 }
525 }
526
527 grouping relay-agent-ipv6-stats {
528 description
529 "DHCPv4 relay agent message statistics";
530
531 leaf dhcpv6-solicit-received {
532 type yang:counter64;
533 description
534 "Number of DHCPv6 SOLICIT messages received from clients
535 by the relay agent";
536 }
537
538 leaf dhcpv6-decline-received {
539 type yang:counter64;
540 description
541 "Number of DHCPv6 DECLINE messages received from
542 clients by the relay agent";
543 }
544
545 leaf dhcpv6-request-received {
546 type yang:counter64;
547 description
548 "Number of DHCPv6 request messages received from clients
549 by the relay agent";
550 }
551
552 leaf dhcpv6-release-received {
553 type yang:counter64;
554 description
555 "Number of DHCPv6 release messages received from clients
556 by the relay agent";
557 }
558
559 leaf dhcpv6-confirm-received {
560 type yang:counter64;
561 description
562 "Number of DHCPv6 confirm messages received from clients
563 by the relay agent";
564 }
565
566 leaf dhcpv6-rebind-received {
567 type yang:counter64;
568 description
569 "Number of DHCPv6 rebind messages received from clients
570 by the relay agent";
571 }
572
573 leaf dhcpv6-info-request-received {
574 type yang:counter64;
575 description
576 "Number of DHCPv6 information requests messages received from
577 clients by the relay agent";
578 }
579
580 leaf dhcpv6-relay-reply-received {
581 type yang:counter64;
582 description
583 "Number of DHCPv6 relay reply messages received from servers
584 by the relay agent";
585 }
586
587 leaf dhcpv6-adverstise-sent {
588 type yang:counter64;
589 description
590 "Number of DHCPv6 adverstise messages sent to clients by
591 the relay agent";
592 }
593
594 leaf dhcpv6-reply-sent {
595 type yang:counter64;
596 description
597 "Number of DHCPv6 reply messages sent to clients by
598 the relay agent";
599 }
600
601 leaf dhcpv6-reconfigure-sent {
602 type yang:counter64;
603 description
604 "Number of DHCPv6 reconfigure messages sent to clients by
605 the relay agent";
606 }
607
608 leaf dhcpv6-relay-forw-sent {
609 type yang:counter64;
610 description
611 "Number of DHCPv6 relay-forward messages sent to servers
612 by the relay agent";
613 }
614
615 }
616
617 grouping relay-agent-ipv4-interfaces-config {
618 description
619 "Configuration data for interfaces enabled for relaying";
620
621 leaf id {
622 type oc-if:interface-id;
623 description
624 "Name of the interface on which relay agent is active";
625 }
626
627 leaf enable {
628 type boolean;
629 description
630 "Enables the relay agent on the referenced interface.
631 At least one helper address should also be configured
632 for forwarding requested.";
633 }
634
635 leaf-list helper-address {
636 type inet:ip-address;
637 description
638 "List of IPv4 or IPv6 addresses of DHCP servers to which the
639 relay agent should forward DHCPv4 requests. The relay agent is
640 expected to forward DHCPv4/BOOTP requests to all listed
641 server addresses when DHCPv4 relaying is enabled globally, or
642 on the interface.";
643 }
644 }
645
646 grouping relay-agent-ipv4-interfaces-state {
647 description
648 "Operational state data for interfaces enabled for relaying";
649
650 container counters {
651 description
652 "Counters and statistics for relay agent operation.";
653
654 uses relay-agent-common-stats;
655 uses relay-agent-ipv4-stats;
656 }
657 }
658
659 grouping relay-agent-ipv4-interfaces-top {
660 description
661 "Top-level grouping for DHCPv4 relays on interfaces";
662
663 container interfaces {
664 description
665 "Enclosing container for the list of interface references.";
666
667 list interface {
668 key "id";
669 description
670 "List of interfaces on which the relay agent is
671 configured.";
672
673 leaf id {
674 type leafref {
675 path "../config/id";
676 }
677 description
678 "Reference to the interface list key";
679 }
680
681 container config {
682 description
683 "Configuration data for relay agent interfaces.";
684
685 uses relay-agent-ipv4-interfaces-config;
686 }
687
688 container state {
689
690 config false;
691
692 description
693 "Operational state data for relay agent interfaces.";
694
695 uses relay-agent-ipv4-interfaces-config;
696 uses relay-agent-ipv4-interfaces-state;
697 }
698
699 uses oc-if:interface-ref;
700 uses agent-information-ipv4-interface-top;
701 }
702 }
703 }
704
705 grouping relay-agent-ipv6-interfaces-config {
706 description
707 "Configuration data for interfaces enabled for relaying";
708
709 leaf id {
710 type oc-if:interface-id;
711 description
712 "Name of the interface on which relay agent is active";
713 }
714
715 leaf enable {
716 type boolean;
717 description
718 "Enables the relay agent on the referenced interface.
719 At least one helper address should also be configured
720 for forwarding requested.";
721 }
722
723 leaf-list helper-address {
724 type inet:ipv6-address;
725 description
726 "List of IPv6 addresses of DHCP servers to which the
727 relay agent should forward DHCPv6 requests. The relay agent
728 is expected to forward DHCPv4/BOOTP requests to all listed
729 server addresses when DHCPv6 relaying is enabled globally, or
730 on the interface.";
731 }
732 }
733
734 grouping relay-agent-ipv6-interfaces-state {
735 description
736 "Operational state data for interfaces enabled for relaying";
737
738 container counters {
739 description
740 "Counters and statistics for relay agent operation.";
741
742 uses relay-agent-common-stats;
743 uses relay-agent-ipv6-stats;
744 }
745 }
746
747 grouping relay-agent-ipv6-interfaces-top {
748 description
749 "Top-level grouping for DHCPv4 relays on interfaces";
750
751 container interfaces {
752 description
753 "Enclosing container for the list of interface references.";
754
755 list interface {
756 key "id";
757 description
758 "List of interfaces on which the relay agent is
759 configured.";
760
761 leaf id {
762 type leafref {
763 path "../config/id";
764 }
765 description
766 "Reference to the interface list key";
767 }
768
769 container config {
770 description
771 "Configuration data for relay agent interfaces.";
772
773 uses relay-agent-ipv6-interfaces-config;
774 }
775
776 container state {
777
778 config false;
779
780 description
781 "Operational state data for relay agent interfaces.";
782
783 uses relay-agent-ipv6-interfaces-config;
784 uses relay-agent-ipv6-interfaces-state;
785 }
786
787 uses oc-if:interface-ref;
788 uses agent-options-ipv6-interface-top;
789 }
790 }
791 }
792
793 grouping relay-agent-top {
794 description
795 "Top-level container for relay agent configuration and opstate
796 data.";
797
798 container relay-agent {
799 description
800 "Top level container for relay-agent configuration and
801 operational state data";
802
803 uses relay-agent-ipv4-top;
804 uses relay-agent-ipv6-top;
805 }
806 }
807
808 // data definition statements
809
810 uses relay-agent-top;
811
812 // augment statements
813
814
815}