summaryrefslogtreecommitdiffstats
path: root/src/lib/dhcpsrv/cfg_rsoo.cc
diff options
context:
space:
mode:
authorAndrei Pavel <andrei.pavel@qualitance.com>2017-08-17 19:54:15 +0200
committerAndrei Pavel <andrei.pavel@qualitance.com>2017-08-17 19:54:15 +0200
commita8f6403d1b44f62ebb3dd3085e401b46767003a0 (patch)
tree00df52bd413b27ed04097164021251f8e8ec6c80 /src/lib/dhcpsrv/cfg_rsoo.cc
parentRemoved duplicate include (diff)
parent[master] Added ChangeLog 1288 for trac 5315. (diff)
downloadkea-a8f6403d1b44f62ebb3dd3085e401b46767003a0.tar.xz
kea-a8f6403d1b44f62ebb3dd3085e401b46767003a0.zip
Merge branch 'isc-master' into config-h
Diffstat (limited to 'src/lib/dhcpsrv/cfg_rsoo.cc')
-rw-r--r--src/lib/dhcpsrv/cfg_rsoo.cc16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/lib/dhcpsrv/cfg_rsoo.cc b/src/lib/dhcpsrv/cfg_rsoo.cc
index a08652c2c7..30f02e67c2 100644
--- a/src/lib/dhcpsrv/cfg_rsoo.cc
+++ b/src/lib/dhcpsrv/cfg_rsoo.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015,2017 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -8,6 +8,9 @@
#include <dhcp/dhcp6.h>
#include <dhcpsrv/cfg_rsoo.h>
+#include <boost/lexical_cast.hpp>
+
+using namespace isc::data;
namespace isc {
namespace dhcp {
@@ -35,6 +38,17 @@ CfgRSOO::enable(const uint16_t code) {
}
}
+ElementPtr
+CfgRSOO::toElement() const {
+ ElementPtr result = Element::createList();
+ // We can use LibDHCP::getOptionDef(DHCP6_OPTION_SPACE, *opt) too...
+ for (std::set<uint16_t>::const_iterator opt = rsoo_options_.cbegin();
+ opt != rsoo_options_.cend(); ++opt) {
+ const std::string& code = boost::lexical_cast<std::string>(*opt);
+ result->add(Element::create(code));
+ }
+ return (result);
+}
}
}