required the expression is evaluated on the query packet and the result
is used by the action for instance to add a new option.
+@section libdhcp_flex_optionMTCompatibility Multi-Threading Compaibility
+
+The libdhcp_flex_option hooks library is compatible with multi-threading.
+
*/
return (0);
}
+/// @brief This function is called to know the multi-threading compatibility.
+///
+/// @return 1 which means compatible with multi-threading.
+int multi_threading_compatible() {
+ return (1);
+}
+
} // end extern "C"
-// Copyright (C) 2017-2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2017-2019 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
points via which the server removing the lease from the database could
notify the partner about such removal.
+@section haMTCompatibility Multi-Threading Compatibility
+
+The High Availability hooks library currently reports it is not
+compatible with multi-threading. This will be revisited as there is
+no essential reason for such uncompatibility.
+
*/
-// Copyright (C) 2017-2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2017-2019 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
return (0);
}
+/// @brief This function is called to know the multi-threading compatibility.
+///
+/// @note: this should be revisited as the library is not essentially
+/// uncompatible.
+///
+/// @return 0 which means not compatible with multi-threading.
+int multi_threading_compatible() {
+ return (0);
+}
} // end extern "C"
#include <dhcpsrv/dhcpsrv_exceptions.h>
#include <dhcpsrv/lease_mgr.h>
#include <dhcpsrv/lease_mgr_factory.h>
+#include <dhcpsrv/multi_threading_utils.h>
#include <dhcpsrv/subnet_id.h>
#include <dhcpsrv/sanity_checker.h>
#include <dhcp/duid.h>
return (failed_lease_map);
}
+// Do lease changes in a critical section.
+
int
LeaseCmds::leaseAddHandler(CalloutHandle& handle) {
- return(impl_->leaseAddHandler(handle));
+ MultiThreadingCriticalSection cs;
+ return (impl_->leaseAddHandler(handle));
}
int
LeaseCmds::lease6BulkApplyHandler(CalloutHandle& handle) {
+ MultiThreadingCriticalSection cs;
return (impl_->lease6BulkApplyHandler(handle));
}
int
LeaseCmds::leaseGetHandler(CalloutHandle& handle) {
- return(impl_->leaseGetHandler(handle));
+ return (impl_->leaseGetHandler(handle));
}
int
int
LeaseCmds::lease4DelHandler(CalloutHandle& handle) {
- return(impl_->lease4DelHandler(handle));
+ MultiThreadingCriticalSection cs;
+ return (impl_->lease4DelHandler(handle));
}
int
LeaseCmds::lease6DelHandler(CalloutHandle& handle) {
- return(impl_->lease6DelHandler(handle));
+ MultiThreadingCriticalSection cs;
+ return (impl_->lease6DelHandler(handle));
}
int
LeaseCmds::lease4UpdateHandler(CalloutHandle& handle) {
- return(impl_->lease4UpdateHandler(handle));
+ MultiThreadingCriticalSection cs;
+ return (impl_->lease4UpdateHandler(handle));
}
int
LeaseCmds::lease6UpdateHandler(CalloutHandle& handle) {
- return(impl_->lease6UpdateHandler(handle));
+ MultiThreadingCriticalSection cs;
+ return (impl_->lease6UpdateHandler(handle));
}
int
LeaseCmds::lease4WipeHandler(CalloutHandle& handle) {
- return(impl_->lease4WipeHandler(handle));
+ MultiThreadingCriticalSection cs;
+ return (impl_->lease4WipeHandler(handle));
}
int
LeaseCmds::lease6WipeHandler(CalloutHandle& handle) {
- return(impl_->lease6WipeHandler(handle));
+ MultiThreadingCriticalSection cs;
+ return (impl_->lease6WipeHandler(handle));
}
LeaseCmds::LeaseCmds()
-// Copyright (C) 2017-2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2017-2019 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
queries that could retrieve or otherwise enumerate leases for a specific subnet,
a new query type and a new index had to be added.
+@section lease_cmdsTCompatibility Multi-Threading Compatibility
+
+The Lease Commands Hook library is compatible with multi-threading.
+All commands modifying leases are performed inside a critical section
+i.e. with the DHCP server stopped.
+
*/
return (0);
}
+/// @brief This function is called to know the multi-threading compatibility.
+///
+/// @return 1 which means compatible with multi-threading.
+int multi_threading_compatible() {
+ return (1);
+}
+
} // end extern "C"
return (0);
}
+/// @brief This function is called to know the multi-threading compatibility.
+///
+/// @note: the compatibility is based on the assumption this hook library
+/// is always called from the main thread.
+///
+/// @return 1 which means compatible with multi-threading.
+int multi_threading_compatible() {
+ return (1);
+}
} // end extern "C"
}
@endcode
+@section stat_cmdsMTCompatibility Multi-Threading Compatibility
+
+The Stat Commands Hook library currently reports it is not
+compatible with multi-threading. This will be revisited as there is
+no essential reason for such uncompatibility.
+
*/
-// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2019 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the End User License
// Agreement. See COPYING file in the premium/ directory.
return (0);
}
+/// @brief This function is called to know the multi-threading compatibility.
+///
+/// @note: this should be revisited as the library is not essentially
+/// uncompatible.
+///
+/// @return 0 which means not compatible with multi-threading.
+int multi_threading_compatible() {
+ return (0);
+}
+
} // end extern "C"
-// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2019 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
Note the library always opens this file in append mode and does not limit its size.
+@section libdhcp_user_chkMTCompatibility Multi-Threading Compaibility
+The user_chk hooks library does not define a multi_threading_compatible()
+C function so is considered as not compatible with multi-threading
+(and the current code should be in fact really not compatible).
*/