|
@@ -28,6 +28,7 @@
|
|
#include <dhcpsrv/subnet.h>
|
|
#include <dhcpsrv/subnet.h>
|
|
#include <dhcpsrv/timer_mgr.h>
|
|
#include <dhcpsrv/timer_mgr.h>
|
|
#include <dhcpsrv/triplet.h>
|
|
#include <dhcpsrv/triplet.h>
|
|
|
|
+#include <dhcpsrv/parsers/client_class_def_parser.h>
|
|
#include <dhcpsrv/parsers/dbaccess_parser.h>
|
|
#include <dhcpsrv/parsers/dbaccess_parser.h>
|
|
#include <dhcpsrv/parsers/dhcp_config_parser.h>
|
|
#include <dhcpsrv/parsers/dhcp_config_parser.h>
|
|
#include <dhcpsrv/parsers/dhcp_parsers.h>
|
|
#include <dhcpsrv/parsers/dhcp_parsers.h>
|
|
@@ -701,6 +702,8 @@ DhcpConfigParser* createGlobal6DhcpConfigParser(const std::string& config_id,
|
|
parser = new ControlSocketParser(config_id);
|
|
parser = new ControlSocketParser(config_id);
|
|
} else if (config_id.compare("expired-leases-processing") == 0) {
|
|
} else if (config_id.compare("expired-leases-processing") == 0) {
|
|
parser = new ExpirationConfigParser();
|
|
parser = new ExpirationConfigParser();
|
|
|
|
+ } else if (config_id.compare("client-classes") == 0) {
|
|
|
|
+ parser = new ClientClassDefListParser(config_id, globalContext());
|
|
} else {
|
|
} else {
|
|
isc_throw(DhcpConfigError,
|
|
isc_throw(DhcpConfigError,
|
|
"unsupported global configuration parameter: "
|
|
"unsupported global configuration parameter: "
|
|
@@ -763,6 +766,7 @@ configureDhcp6Server(Dhcpv6Srv&, isc::data::ConstElementPtr config_set) {
|
|
ParserPtr option_parser;
|
|
ParserPtr option_parser;
|
|
ParserPtr iface_parser;
|
|
ParserPtr iface_parser;
|
|
ParserPtr leases_parser;
|
|
ParserPtr leases_parser;
|
|
|
|
+ ParserPtr client_classes_parser;
|
|
|
|
|
|
// Some of the parsers alter state of the system that can't easily
|
|
// Some of the parsers alter state of the system that can't easily
|
|
// be undone. (Or alter it in a way such that undoing the change
|
|
// be undone. (Or alter it in a way such that undoing the change
|
|
@@ -815,6 +819,8 @@ configureDhcp6Server(Dhcpv6Srv&, isc::data::ConstElementPtr config_set) {
|
|
// can be run here before other parsers.
|
|
// can be run here before other parsers.
|
|
parser->build(config_pair.second);
|
|
parser->build(config_pair.second);
|
|
iface_parser = parser;
|
|
iface_parser = parser;
|
|
|
|
+ } else if (config_pair.first == "client-classes") {
|
|
|
|
+ client_classes_parser = parser;
|
|
} else {
|
|
} else {
|
|
// Those parsers should be started before other
|
|
// Those parsers should be started before other
|
|
// parsers so we can call build straight away.
|
|
// parsers so we can call build straight away.
|
|
@@ -836,6 +842,15 @@ configureDhcp6Server(Dhcpv6Srv&, isc::data::ConstElementPtr config_set) {
|
|
option_parser->commit();
|
|
option_parser->commit();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // The class definitions parser is the next one to be run.
|
|
|
|
+ std::map<std::string, ConstElementPtr>::const_iterator cc_config =
|
|
|
|
+ values_map.find("client-classes");
|
|
|
|
+ if (cc_config != values_map.end()) {
|
|
|
|
+ config_pair.first = "client-classes";
|
|
|
|
+ client_classes_parser->build(cc_config->second);
|
|
|
|
+ client_classes_parser->commit();
|
|
|
|
+ }
|
|
|
|
+
|
|
// The subnet parser is the next one to be run.
|
|
// The subnet parser is the next one to be run.
|
|
std::map<std::string, ConstElementPtr>::const_iterator subnet_config =
|
|
std::map<std::string, ConstElementPtr>::const_iterator subnet_config =
|
|
values_map.find("subnet6");
|
|
values_map.find("subnet6");
|