const uint16_t TEST_PORT = 5301;
const size_t MAX_SIZE = 1024;
const long TEST_TIMEOUT = 5 * 1000;
-/// @brief Test Fixture class.
+/// @brief Test Fixture class
//
// This test fixture class implements DNSClient::Callback so as it can be
// installed as a completion callback for tests it implements. This callback
int received_;
int expected_;
- /// @brief Constructor.
+ /// @brief Constructor
//
// This constructor overrides the default logging level of asiodns logger to
// prevent it from emitting debug messages from IOFetch class. Such an error
TEST_TIMEOUT);
}
- /// @brief Destructor.
+ /// @brief Destructor
//
// Sets the asiodns logging level back to DEBUG.
virtual ~DNSClientTest() {
asiodns::logger.setSeverity(isc::log::DEBUG);
};
- /// @brief Exchange completion callback.
+ /// @brief Exchange completion callback
//
// This callback is called when the exchange with the DNS server is
// complete or an error occurred. This includes the occurrence of a timeout.
}
}
- /// @brief Handler invoked when test timeout is hit.
+ /// @brief Handler invoked when test timeout is hit
//
// This callback stops all running (hanging) tasks on IO service.
void testTimeoutHandler() {
FAIL() << "Test timeout hit.";
}
- /// @brief Handler invoked when test request is received.
+ /// @brief Handler invoked when test request is received
//
// This callback handler is installed when performing async read on a
// socket to emulate reception of the DNS Update request by a server.
#ifndef BASE_HOST_DATA_SOURCE_H
#define BASE_HOST_DATA_SOURCE_H
+#include <asiolink/io_address.h>
#include <dhcp/duid.h>
#include <dhcp/hwaddr.h>
#include <dhcpsrv/host.h>
-
-#include <asiolink/io_address.h>
#include <exceptions/exceptions.h>
-#include <stdint.h>
-
#include <boost/shared_ptr.hpp>
namespace isc {
/// @param duid client id or NULL if not available, e.g. DHCPv4 client case.
///
/// @return Collection of const @c Host objects.
- virtual ConstHostCollection getAll(const HWAddrPtr& hwaddr,
- const DuidPtr& duid = DuidPtr()) const = 0;
+ virtual ConstHostCollection
+ getAll(const HWAddrPtr& hwaddr, const DuidPtr& duid = DuidPtr()) const = 0;
/// @brief Return all hosts connected to any subnet for which reservations
/// have been made using a specified identifier.
/// @param identifier_len Identifier length.
///
/// @return Collection of const @c Host objects.
- virtual ConstHostCollection getAll(const Host::IdentifierType& identifier_type,
- const uint8_t* identifier_begin,
- const size_t identifier_len) const = 0;
+ virtual ConstHostCollection
+ getAll(const Host::IdentifierType& identifier_type,
+ const uint8_t* identifier_begin,
+ const size_t identifier_len) const = 0;
/// @brief Returns a collection of hosts using the specified IPv4 address.
///
/// @param address IPv4 address for which the @c Host object is searched.
///
/// @return Collection of const @c Host objects.
- virtual ConstHostCollection getAll4(const asiolink::IOAddress& address) const = 0;
+ virtual ConstHostCollection
+ getAll4(const asiolink::IOAddress& address) const = 0;
/// @brief Returns a host connected to the IPv4 subnet.
///
/// @param duid client id or NULL if not available.
///
/// @return Const @c Host object using a specified HW address or DUID.
- virtual ConstHostPtr get4(const SubnetID& subnet_id, const HWAddrPtr& hwaddr,
- const DuidPtr& duid = DuidPtr()) const = 0;
+ virtual ConstHostPtr
+ get4(const SubnetID& subnet_id, const HWAddrPtr& hwaddr,
+ const DuidPtr& duid = DuidPtr()) const = 0;
/// @brief Returns a host connected to the IPv4 subnet.
///
/// @return Const @c Host object for which reservation has been made using
/// the specified identifier.
- virtual ConstHostPtr get4(const SubnetID& subnet_id,
- const Host::IdentifierType& identifier_type,
- const uint8_t* identifier_begin,
- const size_t identifier_len) const = 0;
+ virtual ConstHostPtr
+ get4(const SubnetID& subnet_id,
+ const Host::IdentifierType& identifier_type,
+ const uint8_t* identifier_begin,
+ const size_t identifier_len) const = 0;
/// @brief Returns a host connected to the IPv4 subnet and having
/// a reservation for a specified IPv4 address.
/// @param address reserved IPv4 address.
///
/// @return Const @c Host object using a specified IPv4 address.
- virtual ConstHostPtr get4(const SubnetID& subnet_id,
- const asiolink::IOAddress& address) const = 0;
+ virtual ConstHostPtr
+ get4(const SubnetID& subnet_id,
+ const asiolink::IOAddress& address) const = 0;
/// @brief Returns a host connected to the IPv6 subnet.
///
/// @param duid DUID or NULL if not available.
///
/// @return Const @c Host object using a specified HW address or DUID.
- virtual ConstHostPtr get6(const SubnetID& subnet_id,
- const DuidPtr& duid,
- const HWAddrPtr& hwaddr = HWAddrPtr()) const = 0;
+ virtual ConstHostPtr
+ get6(const SubnetID& subnet_id, const DuidPtr& duid,
+ const HWAddrPtr& hwaddr = HWAddrPtr()) const = 0;
/// @brief Returns a host connected to the IPv6 subnet.
///
///
/// @return Const @c Host object for which reservation has been made using
/// the specified identifier.
- virtual ConstHostPtr get6(const SubnetID& subnet_id,
- const Host::IdentifierType& identifier_type,
- const uint8_t* identifier_begin,
- const size_t identifier_len) const = 0;
+ virtual ConstHostPtr
+ get6(const SubnetID& subnet_id,
+ const Host::IdentifierType& identifier_type,
+ const uint8_t* identifier_begin,
+ const size_t identifier_len) const = 0;
/// @brief Returns a host using the specified IPv6 prefix.
///
/// @param prefix_len IPv6 prefix length.
///
/// @return Const @c Host object using a specified HW address or DUID.
- virtual ConstHostPtr get6(const asiolink::IOAddress& prefix,
- const uint8_t prefix_len) const = 0;
+ virtual ConstHostPtr
+ get6(const asiolink::IOAddress& prefix, const uint8_t prefix_len) const = 0;
/// @brief Returns a host connected to the IPv6 subnet and having
/// a reservation for a specified IPv6 address or prefix.
/// @brief HostDataSource pointer
typedef boost::shared_ptr<BaseHostDataSource> HostDataSourcePtr;
-} // namespace dhcp
-} // namespace isc
+}
+}
#endif // BASE_HOST_DATA_SOURCE_H
///
/// @param client_classes list of all classes the client belongs to
/// @return true if client can be supported, false otherwise
- bool clientSupported(const isc::dhcp::ClientClasses& client_classes) const;
+ bool
+ clientSupported(const isc::dhcp::ClientClasses& client_classes) const;
/// @brief adds class class_name to the list of supported classes
///
/// Also see explanation note in @ref white_list_.
///
/// @param class_name client class to be supported by this subnet
- void allowClientClass(const isc::dhcp::ClientClass& class_name);
+ void
+ allowClientClass(const isc::dhcp::ClientClass& class_name);
/// @brief returns the client class white list
///
/// performance reasons.
///
/// @return whether in-pool host reservations are allowed.
- HRMode getHostReservationMode() const {
+ HRMode
+ getHostReservationMode() const {
return (host_reservation_mode_);
}
///
/// See @ref HRMode type for details.
HRMode host_reservation_mode_;
-
private:
+
/// @brief Pointer to the option data configuration for this subnet.
CfgOptionPtr cfg_option_;
};