" \"option-data\": [ {"
" \"name\": \"OPTION_DNS_SERVERS\","
" \"code\": 23,"
- " \"data\": \"2001 0DB8 1234 FFFF 0000 0000 0000 0001"
- "2001 0DB8 1234 FFFF 0000 0000 0000 0002\","
- " \"csv-format\": False"
+ " \"data\": \"2001:db8:1234:FFFF::1, 2001:db8:1234:FFFF::2\","
+ " \"csv-format\": True"
" },"
" {"
" \"name\": \"OPTION_FOO\","
#include <dhcp/option_int.h>
#include <dhcp/option_int_array.h>
#include <util/encode/hex.h>
+#include <util/strutil.h>
using namespace std;
using namespace isc::util;
if (values.empty()) {
isc_throw(InvalidOptionValue, "no option value specified");
}
- writeToBuffer(values[0], type_, buf);
+ writeToBuffer(util::str::trim(values[0]), type_, buf);
} else if (array_type_ && type_ != OPT_RECORD_TYPE) {
for (size_t i = 0; i < values.size(); ++i) {
- writeToBuffer(values[i], type_, buf);
+ writeToBuffer(util::str::trim(values[i]), type_, buf);
}
} else if (type_ == OPT_RECORD_TYPE) {
const RecordFieldsCollection& records = getRecordFields();
<< " provided.");
}
for (size_t i = 0; i < records.size(); ++i) {
- writeToBuffer(values[i], records[i], buf);
+ writeToBuffer(util::str::trim(values[i]),
+ records[i], buf);
}
}
return (optionFactory(u, type, buf.begin(), buf.end()));