A debug message indicating that the DHCPv4 server has received an
updated configuration from the BIND 10 configuration system.
-% DHCP4_DB_BACKEND_STARTED lease database started (type: %1, name: %2)
-This informational message is printed every time DHCPv4 server is started
-and gives both the type and name of the database being used to store
-lease and other information.
-
% DHCP4_DDNS_REQUEST_SEND_FAILED failed sending a request to b10-dhcp-ddns, error: %1, ncr: %2
This error message indicates that DHCP4 server attempted to send a DDNS
update reqeust to the DHCP-DDNS server. This is most likely a configuration or
const std::string Dhcpv4Srv::VENDOR_CLASS_PREFIX("VENDOR_CLASS_");
-Dhcpv4Srv::Dhcpv4Srv(uint16_t port, const char* dbconfig, const bool use_bcast,
+Dhcpv4Srv::Dhcpv4Srv(uint16_t port, const bool use_bcast,
const bool direct_response_desired)
-: shutdown_(true), alloc_engine_(), port_(port),
- use_bcast_(use_bcast), hook_index_pkt4_receive_(-1),
- hook_index_subnet4_select_(-1), hook_index_pkt4_send_(-1) {
+ : shutdown_(true), alloc_engine_(), port_(port),
+ use_bcast_(use_bcast), hook_index_pkt4_receive_(-1),
+ hook_index_subnet4_select_(-1), hook_index_pkt4_send_(-1) {
LOG_DEBUG(dhcp4_logger, DBG_DHCP4_START, DHCP4_OPEN_SOCKET).arg(port);
try {
IfaceMgr::instance().openSockets4(port_, use_bcast_, error_handler);
}
- // Instantiate LeaseMgr
- LeaseMgrFactory::create(dbconfig);
- LOG_INFO(dhcp4_logger, DHCP4_DB_BACKEND_STARTED)
- .arg(LeaseMgrFactory::instance().getType())
- .arg(LeaseMgrFactory::instance().getName());
-
// Instantiate allocation engine
alloc_engine_.reset(new AllocEngine(AllocEngine::ALLOC_ITERATIVE, 100,
false /* false = IPv4 */));
/// root privileges.
///
/// @param port specifies port number to listen on
- /// @param dbconfig Lease manager configuration string. The default
- /// of the "memfile" manager is used for testing.
/// @param use_bcast configure sockets to support broadcast messages.
/// @param direct_response_desired specifies if it is desired to
/// use direct V4 traffic.
Dhcpv4Srv(uint16_t port = DHCP4_SERVER_PORT,
- const char* dbconfig = "type=memfile universe=4",
const bool use_bcast = true,
const bool direct_response_desired = true);
/// @brief Constructor
D2Dhcpv4Srv()
- : Dhcpv4Srv(0, "type=memfile", false, false), error_count_(0) {
+ : Dhcpv4Srv(0, false, false), error_count_(0) {
}
/// @brief virtual Destructor.
// Check that the base class can be instantiated
boost::scoped_ptr<Dhcpv4Srv> srv;
- ASSERT_NO_THROW(srv.reset(new Dhcpv4Srv(DHCP4_SERVER_PORT + 10000, "type=memfile",
- false, false)));
+ ASSERT_NO_THROW(srv.reset(new Dhcpv4Srv(DHCP4_SERVER_PORT + 10000, false,
+ false)));
srv.reset();
// We have to close open sockets because further in this test we will
// call the Dhcpv4Srv constructor again. This constructor will try to
#include <dhcp/pkt_filter_inet.h>
#include <dhcpsrv/subnet.h>
#include <dhcpsrv/lease.h>
+#include <dhcpsrv/lease_mgr_factory.h>
#include <dhcp4/dhcp4_srv.h>
#include <asiolink/io_address.h>
#include <config/ccsession.h>
/// @param port port number to listen on; the default value 0 indicates
/// that sockets should not be opened.
NakedDhcpv4Srv(uint16_t port = 0)
- : Dhcpv4Srv(port, "type=memfile universe=4 persist=false",
- false, false) {
+ : Dhcpv4Srv(port, false, false) {
+ // Create a default lease database backend.
+ std::string dbconfig = "type=memfile universe=4 persist=false";
+ isc::dhcp::LeaseMgrFactory::create(dbconfig);
// Create fixed server id.
server_id_.reset(new Option4AddrLst(DHO_DHCP_SERVER_IDENTIFIER,
asiolink::IOAddress("192.0.3.1")));