module ietf-example-dhcpv6-class-selector {
yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:" +
"ietf-example-dhcpv6-class-selector";
prefix "dhcpv6-class-selector";
import ietf-inet-types {
prefix inet;
}
import ietf-interfaces {
prefix if;
}
import ietf-dhcpv6-common {
prefix dhcpv6-common;
}
import ietf-dhcpv6-server {
prefix dhcpv6-server;
}
organization
"IETF DHC (Dynamic Host Configuration) Working Group";
contact
"WG Web:
WG List:
Author: Yong Cui
Author: Linhui Sun
Editor: Ian Farrer
Author: Sladjana Zeichlin
Author: Zihao He
Author: Michal Nowikowski ";
description "This YANG module defines components for the definition
and configuration of the client class selector function for a
DHCPv6 server. As this functionality varies greatly between
different implementations, the module provided as an example
only.
Copyright (c) 2021 IETF Trust and the persons identified as
authors of the code. All rights reserved.
Redistribution and use in source and binary forms, with or
without modification, is permitted pursuant to, and subject
to the license terms contained in, the Simplified BSD License
set forth in Section 4.c of the IETF Trust's Legal Provisions
Relating to IETF Documents
(http://trustee.ietf.org/license-info).
This version of this YANG module is part of RFC XXXX; see
the RFC itself for full legal notices.";
revision 2021-02-22 {
description "Version update for draft -18 publication.";
reference "I-D: draft-ietf-dhc-dhcpv6-yang-18";
}
revision 2021-01-29 {
description "Version update for draft -17 publication.";
reference "I-D: draft-ietf-dhc-dhcpv6-yang-17";
}
revision 2021-01-06 {
description "Version update for draft -16 publication.";
reference "I-D: draft-ietf-dhc-dhcpv6-yang-16";
}
revision 2020-12-22 {
description "Version update for draft -13 publication.";
reference "I-D: draft-ietf-dhc-dhcpv6-yang-15";
}
revision 2020-12-10 {
description "Version update for draft -13 publication.";
reference "I-D: draft-ietf-dhc-dhcpv6-yang-13";
}
revision 2020-12-01 {
description "Version update for draft -12 publication.";
reference "I-D: draft-ietf-dhc-dhcpv6-yang-12";
}
revision 2020-05-26 {
description "Version update for draft -11 publication and
to align revisions across the different modules.";
reference "I-D: draft-ietf-dhc-dhcpv6-yang-11";
}
revision 2019-06-13 {
description "";
reference "I-D: draft-ietf-dhc-dhcpv6-yang";
}
/*
* Groupings
*/
grouping client-class-id {
description "Definitions of client message classification for
authorization and assignment purposes.";
leaf client-class-name {
type string;
description "Unique Identifier for client class identification
list entries.";
}
choice id-type {
mandatory true;
description "Definitions for different client identifier
types.";
case client-id-id {
leaf client-id {
type string;
mandatory true;
description "String literal client identifier.";
}
description "Client class selection based on a string literal
client identifier.";
}
case received-interface-id {
description "Client class selection based on the incoming
interface of the DHCPv6 message.";
leaf received-interface {
type if:interface-ref;
description "Reference to the interface entry
for the incoming DHCPv6 message.";
}
}
case packet-source-address-id {
description "Client class selection based on the source
address of the DHCPv6 message.";
leaf packet-source-address {
type inet:ipv6-address;
mandatory true;
description "Source address of the DHCPv6 message.";
}
}
case packet-destination-address-id {
description "Client class selection based on the destination
address of the DHCPv6 message.";
leaf packet-destination-address {
type inet:ipv6-address;
mandatory true;
description "Destination address of the DHCPv6 message.";
}
}
case relay-link-address-id {
description "Client class selection based on the prefix
of the link-address field in the relay agent message
header.";
leaf relay-link-address {
type inet:ipv6-prefix;
mandatory true;
description "Prefix of the link-address field in the relay
agent message header.";
}
}
case relay-peer-address-id {
description "Client class selection based on the value of the
peer-address field in the relay agent message header.";
leaf relay-peer-address {
type inet:ipv6-prefix;
mandatory true;
description "Prefix of the peer-address field
in the relay agent message header.";
}
}
case relay-interface-id {
description "Client class selection based on the incoming
interface-id option.";
leaf relay-interface {
type string;
description "Reference to the interface entry
for the incoming DHCPv6 message.";
}
}
case user-class-option-id {
description "Client class selection based on the value of the
OPTION_USER_CLASS(15) and its user-class-data field.";
leaf user-class-data {
type string;
mandatory true;
description "Value of the enterprise-number field.";
}
}
case vendor-class-present-id {
description "Client class selection based on the presence of
OPTION_VENDOR_CLASS(16) in the received message.";
leaf vendor-class-present {
type boolean;
mandatory true;
description "Presence of OPTION_VENDOR_CLASS(16)
in the received message.";
}
}
case vendor-class-option-enterprise-number-id {
description "Client class selection based on the value of the
enterprise-number field in OPTION_VENDOR_CLASS(16).";
leaf vendor-class-option-enterprise-number {
type uint32;
mandatory true;
description "Value of the enterprise-number field.";
}
}
case vendor-class-option-data-id {
description "Client class selection based on the value
of a data field within a vendor-class-data entry
for a matching enterprise-number field
in OPTION_VENDOR_CLASS(16).";
container vendor-class-option-data {
description "Vendor class option data container.";
leaf vendor-class-option-enterprise-number {
type uint32;
mandatory true;
description "Value of the enterprise-number field
for matching the data contents.";
}
leaf vendor-class-data {
type string;
mandatory true;
description "Vendor class data to match.";
}
}
}
case remote-id {
description "Client class selection based on the value
of Remote-ID .";
container remote-id {
description "Remote-id client class selector container.";
leaf vendor-class-option-enterprise-number {
type uint32;
mandatory true;
description "Value of the enterprise-number field
for matching the data contents.";
}
leaf remote-id {
type string;
mandatory true;
description "Remote-ID data to match.";
}
}
}
case client-duid-id {
description "Client class selection based on the value
of the received client DUID.";
leaf duid {
type dhcpv6-common:duid;
description "Client DUID.";
}
}
}
}
/*
* Augmentations
*/
augment "/dhcpv6-server:dhcpv6-server/dhcpv6-server:class-selector"
{
description "Augment class selector functions to the DHCPv6
server module.";
container client-classes {
description "Client classes to augment.";
list class {
key client-class-name;
description "List of the client class identifiers applicable
to clients served by this address pool";
uses dhcpv6-class-selector:client-class-id;
}
}
}
augment "/dhcpv6-server:dhcpv6-server/" +
"dhcpv6-server:network-ranges/dhcpv6-server:network-range" {
description "Augment class selector functions to the DHCPv6
server network-ranges.";
leaf-list client-class {
type leafref {
path "/dhcpv6-server:dhcpv6-server/dhcpv6-server:" +
"class-selector/client-classes/class/client-class-name";
}
description "Leafrefs to client classes.";
}
}
augment "/dhcpv6-server:dhcpv6-server/dhcpv6-server:" +
"network-ranges/dhcpv6-server:network-range/dhcpv6-server:" +
"address-pools/dhcpv6-server:address-pool" {
description "Augment class selector functions to the DHCPv6
server address-pools.";
leaf-list client-class {
type leafref {
path "/dhcpv6-server:dhcpv6-server/dhcpv6-server:" +
"class-selector/client-classes/class/client-class-name";
}
description "Leafrefs to client classes.";
}
}
augment "/dhcpv6-server:dhcpv6-server/dhcpv6-server:" +
"network-ranges/dhcpv6-server:network-range/dhcpv6-server:" +
"prefix-pools/dhcpv6-server:prefix-pool" {
description "Augment class selector functions to the DHCPv6
server prefix-pools.";
leaf-list client-class {
type leafref {
path "/dhcpv6-server:dhcpv6-server/dhcpv6-server:" +
"class-selector/client-classes/class/client-class-name";
}
description "Leafrefs to client classes.";
}
}
}