getOption4(const ServerSelector& server_selector, const uint16_t code,
const std::string& space) {
return (getOption(GET_OPTION4_CODE_SPACE, Option::V4,
- server_selector, code, space));;
+ server_selector, code, space));
}
/// @brief Sends query to retrieve all global options.
out_bindings.push_back(MySqlBinding::createString(SHARED_NETWORK_NAME_BUF_LENGTH));
// pool_id
out_bindings.push_back(MySqlBinding::createInteger<uint64_t>());
+ // modification_ts
+ out_bindings.push_back(MySqlBinding::createTimestamp());
// pd_pool_id
if (universe == Option::V6) {
out_bindings.push_back(MySqlBinding::createInteger<uint64_t>());
}
- // modification_ts
- out_bindings.push_back(MySqlBinding::createTimestamp());
uint64_t last_option_id = 0;
// its option space and timestamp.
OptionDescriptorPtr desc(new OptionDescriptor(option, persistent, formatted_value));
desc->space_name_ = space;
- // In DHCPv6 the pd_pool_id field shifts the position of the
- // modification_ts field by one.
- size_t ts_idx = (universe == Option::V4 ? 11 : 12);
- desc->setModificationTime((*(first_binding + ts_idx))->getTimestamp());
+ desc->setModificationTime((*(first_binding + 11))->getTimestamp());
return (desc);
}
const std::string& space);
/// @brief Sends query to retrieve single option by code and option space
- /// for a given [pd] pool id.
+ /// for a given address or prefix delegation (v6) pool id.
///
/// @param index Index of the query to be used.
/// @param universe Option universe, i.e. V4 or V6.
" x.user_context," \
" x.shared_network_name," \
" x.pool_id," \
- " x.pd_pool_id," \
" x.modification_ts," \
+ " x.pd_pool_id," \
" y.option_id," \
" y.code," \
" y.value," \
" y.user_context," \
" y.shared_network_name," \
" y.pool_id," \
- " y.pd_pool_id," \
" y.modification_ts," \
+ " y.pd_pool_id," \
" o.option_id," \
" o.code," \
" o.value," \
" o.user_context," \
" o.shared_network_name," \
" o.pool_id," \
- " o.pd_pool_id," \
- " o.modification_ts " \
+ " o.modification_ts," \
+ " o.pd_pool_id " \
"FROM dhcp6_subnet AS s " \
"INNER JOIN dhcp6_subnet_server AS a " \
" ON s.subnet_id = a.subnet_id " \
" o.user_context," \
" o.shared_network_name," \
" o.pool_id," \
- " o.pd_pool_id," \
- " o.modification_ts " \
+ " o.modification_ts," \
+ " o.pd_pool_id " \
"FROM dhcp6_shared_network AS n " \
"INNER JOIN dhcp6_shared_network_server AS a " \
" ON n.id = a.shared_network_id " \
" o.user_context," \
" o.shared_network_name," \
" o.pool_id," \
- pd_pool_id \
" o.modification_ts " \
+ pd_pool_id \
"FROM " #table_prefix "_options AS o " \
"INNER JOIN " #table_prefix "_options_server AS a" \
" ON o.option_id = a.option_id " \
" user_context," \
" shared_network_name," \
" pool_id," \
- pd_pool_id \
" modification_ts" \
+ pd_pool_id \
") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?" last ")"
#endif
" o.user_context = ?," \
" o.shared_network_name = ?," \
" o.pool_id = ?," \
- pd_pool_id \
" o.modification_ts = ? " \
+ pd_pool_id \
"WHERE s.tag = ? " #__VA_ARGS__
#endif