mutable_dhcp->remove("relay-supplied-options");
}
-void
-AdaptorConfig::removeAuthoritativeSubnets(ConstElementPtr subnets) {
- if (!subnets || subnets->empty()) {
- // nothing to do here.
- return;
- }
-
- for (size_t i = 0; i < subnets->size(); ++i) {
- ElementPtr subnet = subnets->getNonConst(i);
- ConstElementPtr auth = subnet->get("authoritative");
- if (auth) {
- subnet->remove("authoritative");
- }
- }
-}
-
-void
-AdaptorConfig::removeAuthoritativeSharedNetworks(ConstElementPtr networks) {
- if (!networks || networks->empty()) {
- // nothing to do here.
- return;
- }
-
- for (size_t i = 0; i < networks->size(); ++i) {
- ElementPtr network = networks->getNonConst(i);
- ConstElementPtr auth = network->get("authoritative");
- if (auth) {
- network->remove("authoritative");
- }
- removeAuthoritativeSubnets(network->get("subnet4"));
- }
-}
-
-void
-AdaptorConfig::removeAuthoritative(ConstElementPtr dhcp) {
- removeAuthoritativeSubnets(dhcp->get("subnet4"));
- removeAuthoritativeSharedNetworks(dhcp->get("shared-networks"));
- ConstElementPtr auth = dhcp->get("authoritative");
- if (!auth) {
- // Done.
- return;
- }
- ElementPtr mutable_dhcp = boost::const_pointer_cast<Element>(dhcp);
- mutable_dhcp->remove("authoritative");
-}
-
void
AdaptorConfig::preProcess(ElementPtr dhcp, const string& subsel,
const string& space) {
sanitizeDatabase(dhcp);
- if (space == DHCP4_SPACE) {
- removeAuthoritative(dhcp);
- } else if (space == DHCP6_SPACE) {
+ if (space == DHCP6_SPACE) {
sanitizeRelaySuppliedOptions(dhcp);
}
}
/// @param dhcp The DHCPv6 server.
static void sanitizeRelaySuppliedOptions(isc::data::ConstElementPtr dhcp);
- /// @brief Remove authoritative flag from a subnet list.
- ///
- /// @param subnets The subnet list.
- static void removeAuthoritativeSubnets(isc::data::ConstElementPtr subnets);
-
- /// @brief Remove authoritative flag from a shared network list.
- ///
- /// Remove authoritative flag in each shared network and its
- /// subnet4 children.
- ///
- /// @param networks The shared network list.
- static void removeAuthoritativeSharedNetworks(isc::data::ConstElementPtr networks);
-
- /// @brief Remove authoritative flags.
- ///
- /// Remove global, shared network and subnet4 authoritative flags.
- ///
- /// @param dhcp The DHCPv4 server.
- static void removeAuthoritative(isc::data::ConstElementPtr dhcp);
-
/// @brief Pre process a configuration.
///
/// Assign subnet IDs, check and set default in options, etc.
}
import kea-types {
prefix kea;
+ revision-date 2018-09-14;
}
import kea-dhcp-types {
prefix dhcp;
+ revision-date 2018-09-14;
}
import kea-logging {
prefix logging;
+ revision-date 2018-09-14;
}
organization "Internet Systems Consortium";
description "This model defines a YANG data model that can be
used to configure and manage a Kea DHCPv4 server.";
- revision 2018-09-14 {
+ revision 2018-11-11 {
description "Initial revision";
reference "";
}
}
}
+ 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:ipv6-prefix;
description "Subnet DHCPv4-over-DHCPv6 IPv6 prefix.";
}
+ uses authoritative;
uses dhcp:subnet-user-context;
}
}
description "Optional information about relay agent.";
uses relay;
}
+ uses authoritative;
uses dhcp:network-reservation-mode;
uses dhcp:network-client-class;
uses dhcp:network-require-client-classes;
description "Global host reservations.";
}
}
+ uses authoritative;
}
container logging {
getParam(result, xpath, "next-server");
getParam(result, xpath, "server-hostname");
getParam(result, xpath, "boot-file-name");
+ getParam(result, xpath, "authoritative");
return (result);
}
if (boot) {
setItem(xpath + "/boot-file-name", boot, SR_STRING_T);
}
+ ConstElementPtr auth = elem->get("authoritative");
+ if (auth) {
+ setItem(xpath + "/authoritative", auth, SR_BOOL_T);
+ }
}
void
if (match) {
result->set("match-client-id", match);
}
+ ConstElementPtr auth = getItem(xpath + "/authoritative");
+ if (auth) {
+ result->set("authoritative", auth);
+ }
ConstElementPtr next = getItem(xpath + "/next-server");
if (next) {
result->set("next-server", next);
if (match) {
setItem(xpath + "/match-client-id", match, SR_BOOL_T);
}
+ ConstElementPtr auth = elem->get("authoritative");
+ if (auth) {
+ setItem(xpath + "/authoritative", auth, SR_BOOL_T);
+ }
ConstElementPtr next = elem->get("next-server");
if (next) {
setItem(xpath + "/next-server", next, SR_STRING_T);
if (match) {
result->set("match-client-id", match);
}
+ ConstElementPtr auth = getItem(xpath + "/authoritative");
+ if (auth) {
+ result->set("authoritative", auth);
+ }
ConstElementPtr next = getItem(xpath + "/next-server");
if (next) {
result->set("next-server", next);
if (match) {
setItem(xpath + "/match-client-id", match, SR_BOOL_T);
}
+ ConstElementPtr auth = elem->get("authoritative");
+ if (auth) {
+ setItem(xpath + "/authoritative", auth, SR_BOOL_T);
+ }
ConstElementPtr next = elem->get("next-server");
if (next) {
setItem(xpath + "/next-server", next, SR_STRING_T);