/// @brief Maximum length of option space name.
const size_t OPTION_SPACE_MAX_LEN = 128;
+/// @brief Maximum length of the server hostname.
+const size_t SERVER_HOSTNAME_MAX_LEN = 64;
+
+/// @brief Maximum length of the boot file name.
+const size_t BOOT_FILE_NAME_MAX_LEN = 128;
+
/// @brief Numeric value representing last supported identifier.
///
/// This value is used to validate whether the identifier type stored in
private:
/// @brief Number of columns returned for SELECT queries send by this class.
- static const size_t HOST_COLUMNS = 9;
+ static const size_t HOST_COLUMNS = 12;
public:
dhcp4_subnet_id_(0), dhcp6_subnet_id_(0), ipv4_address_(0),
hostname_length_(0), dhcp4_client_classes_length_(0),
dhcp6_client_classes_length_(0),
+ dhcp4_next_server_(0),
+ dhcp4_server_hostname_length_(0),
+ dhcp4_boot_file_name_length_(0),
dhcp4_subnet_id_null_(MLM_FALSE),
dhcp6_subnet_id_null_(MLM_FALSE),
ipv4_address_null_(MLM_FALSE), hostname_null_(MLM_FALSE),
dhcp4_client_classes_null_(MLM_FALSE),
- dhcp6_client_classes_null_(MLM_FALSE) {
+ dhcp6_client_classes_null_(MLM_FALSE),
+ dhcp4_next_server_null_(MLM_FALSE),
+ dhcp4_server_hostname_null_(MLM_FALSE),
+ dhcp4_boot_file_name_null_(MLM_FALSE) {
// Fill arrays with 0 so as they don't include any garbage.
memset(dhcp_identifier_buffer_, 0, sizeof(dhcp_identifier_buffer_));
columns_[6] = "hostname";
columns_[7] = "dhcp4_client_classes";
columns_[8] = "dhcp6_client_classes";
+ columns_[9] = "dhcp4_next_server";
+ columns_[10] = "dhcp4_server_hostname";
+ columns_[11] = "dhcp4_boot_file_name";
- BOOST_STATIC_ASSERT(8 < HOST_COLUMNS);
+ BOOST_STATIC_ASSERT(11 < HOST_COLUMNS);
};
/// @brief Virtual destructor.
bind_[8].length = &dhcp6_client_classes_length_;
bind_[8].is_null = &dhcp6_client_classes_null_;
+ // dhcp4_next_server
+ dhcp4_next_server_null_ = MLM_FALSE;
+ bind_[9].buffer_type = MYSQL_TYPE_LONG;
+ bind_[9].buffer = reinterpret_cast<char*>(&dhcp4_next_server_);
+ bind_[9].is_unsigned = MLM_TRUE;
+ bind_[9].is_null = &dhcp4_next_server_null_;
+
+ // dhcp4_server_hostname
+ dhcp4_server_hostname_null_ = MLM_FALSE;
+ dhcp4_server_hostname_length_ = sizeof(dhcp4_server_hostname_);
+ bind_[10].buffer_type = MYSQL_TYPE_STRING;
+ bind_[10].buffer = reinterpret_cast<char*>(dhcp4_server_hostname_);
+ bind_[10].buffer_length = dhcp4_server_hostname_length_;
+ bind_[10].length = &dhcp4_server_hostname_length_;
+ bind_[10].is_null = &dhcp4_server_hostname_null_;
+
+ // dhcp4_boot_file_name
+ dhcp4_boot_file_name_null_ = MLM_FALSE;
+ dhcp4_boot_file_name_length_ = sizeof(dhcp4_boot_file_name_);
+ bind_[11].buffer_type = MYSQL_TYPE_STRING;
+ bind_[11].buffer = reinterpret_cast<char*>(dhcp4_boot_file_name_);
+ bind_[11].buffer_length = dhcp4_boot_file_name_length_;
+ bind_[11].length = &dhcp4_boot_file_name_length_;
+ bind_[11].is_null = &dhcp4_boot_file_name_null_;
+
// Add the error flags
setErrorIndicators(bind_, error_);
/// client classes.
unsigned long dhcp6_client_classes_length_;
+ /// Next server address (siaddr).
+ uint32_t dhcp4_next_server_;
+
+ /// Server hostname (sname).
+ char dhcp4_server_hostname_[SERVER_HOSTNAME_MAX_LEN];
+
+ /// A length of the string holding server hostname.
+ unsigned long dhcp4_server_hostname_length_;
+
+ /// Boot file name (file).
+ char dhcp4_boot_file_name_[BOOT_FILE_NAME_MAX_LEN];
+
+ /// A length of the string holding boot file name.
+ unsigned long dhcp4_boot_file_name_length_;
+
/// @name Boolean values indicating if values of specific columns in
/// the database are NULL.
//@{
/// NULL.
my_bool dhcp6_client_classes_null_;
+ /// Boolean flag indicating if the value of next server is NULL.
+ my_bool dhcp4_next_server_null_;
+
+ /// Boolean flag indicating if the value of server hostname is NULL.
+ my_bool dhcp4_server_hostname_null_;
+
+ /// Boolean flag indicating if the value of boot file name is NULL.
+ my_bool dhcp4_boot_file_name_null_;
+
//@}
};
"SELECT h.host_id, h.dhcp_identifier, h.dhcp_identifier_type, "
"h.dhcp4_subnet_id, h.dhcp6_subnet_id, h.ipv4_address, "
"h.hostname, h.dhcp4_client_classes, h.dhcp6_client_classes, "
+ "h.dhcp4_next_server, h.dhcp4_server_hostname, h.dhcp4_boot_file_name, "
"o4.option_id, o4.code, o4.value, o4.formatted_value, o4.space, "
"o4.persistent, "
"o6.option_id, o6.code, o6.value, o6.formatted_value, o6.space, "
"SELECT h.host_id, h.dhcp_identifier, h.dhcp_identifier_type, "
"h.dhcp4_subnet_id, h.dhcp6_subnet_id, h.ipv4_address, h.hostname, "
"h.dhcp4_client_classes, h.dhcp6_client_classes, "
+ "h.dhcp4_next_server, h.dhcp4_server_hostname, h.dhcp4_boot_file_name, "
"o.option_id, o.code, o.value, o.formatted_value, o.space, "
"o.persistent "
"FROM hosts AS h "
"SELECT h.host_id, h.dhcp_identifier, h.dhcp_identifier_type, "
"h.dhcp4_subnet_id, h.dhcp6_subnet_id, h.ipv4_address, h.hostname, "
"h.dhcp4_client_classes, h.dhcp6_client_classes, "
+ "h.dhcp4_next_server, h.dhcp4_server_hostname, h.dhcp4_boot_file_name, "
"o.option_id, o.code, o.value, o.formatted_value, o.space, "
"o.persistent "
"FROM hosts AS h "
"h.dhcp_identifier_type, h.dhcp4_subnet_id, "
"h.dhcp6_subnet_id, h.ipv4_address, h.hostname, "
"h.dhcp4_client_classes, h.dhcp6_client_classes, "
+ "h.dhcp4_next_server, h.dhcp4_server_hostname, h.dhcp4_boot_file_name, "
"o.option_id, o.code, o.value, o.formatted_value, o.space, "
"o.persistent, "
"r.reservation_id, r.address, r.prefix_len, r.type, "
"SELECT h.host_id, h.dhcp_identifier, h.dhcp_identifier_type, "
"h.dhcp4_subnet_id, h.dhcp6_subnet_id, h.ipv4_address, h.hostname, "
"h.dhcp4_client_classes, h.dhcp6_client_classes, "
+ "h.dhcp4_next_server, h.dhcp4_server_hostname, h.dhcp4_boot_file_name, "
"o.option_id, o.code, o.value, o.formatted_value, o.space, "
"o.persistent "
"FROM hosts AS h "
"h.dhcp_identifier_type, h.dhcp4_subnet_id, "
"h.dhcp6_subnet_id, h.ipv4_address, h.hostname, "
"h.dhcp4_client_classes, h.dhcp6_client_classes, "
+ "h.dhcp4_next_server, h.dhcp4_server_hostname, h.dhcp4_boot_file_name, "
"o.option_id, o.code, o.value, o.formatted_value, o.space, "
"o.persistent, "
"r.reservation_id, r.address, r.prefix_len, r.type, "