mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-09-01 14:35:29 +00:00
[#947] addressed review
This commit is contained in:
@@ -12,8 +12,8 @@
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
// Version 13 of the hooks framework, set for Kea 1.7.4
|
// Version 14 of the hooks framework, set for Kea 1.7.4
|
||||||
const int KEA_HOOKS_VERSION = 13;
|
const int KEA_HOOKS_VERSION = 14;
|
||||||
|
|
||||||
// Names of the framework functions.
|
// Names of the framework functions.
|
||||||
const char* const LOAD_FUNCTION_NAME = "load";
|
const char* const LOAD_FUNCTION_NAME = "load";
|
||||||
|
@@ -265,13 +265,13 @@ If you'd like to check the address family too it is returned in DHCP servers
|
|||||||
by isc::dhcp::CfgMgr::instance().getFamily() declared in dhcpsrv/cfgmgr.h
|
by isc::dhcp::CfgMgr::instance().getFamily() declared in dhcpsrv/cfgmgr.h
|
||||||
with AF_INET and AF_INET6 values.
|
with AF_INET and AF_INET6 values.
|
||||||
|
|
||||||
@subsubsection hooksdgMultiThreadingCompatibleFuntion The
|
@subsubsection hooksdgMultiThreadingCompatibleFunction The
|
||||||
"multi_threading_compatible" function
|
"multi_threading_compatible" function
|
||||||
|
|
||||||
"multi_threading_compatible" is used by the hooks framework to check
|
"multi_threading_compatible" is used by the hooks framework to check
|
||||||
if the libraries it is loading are compatible with the DHCPv4 or DHCPv6
|
if the libraries it is loading are compatible with the DHCPv4 or DHCPv6
|
||||||
erver multi-threading configuration. The value 0 means not compatible
|
server multi-threading configuration. The value 0 means not compatible
|
||||||
and is the default when the function is not implemented. not 0 values
|
and is the default when the function is not implemented. Non 0 values
|
||||||
mean compatible.
|
mean compatible.
|
||||||
|
|
||||||
If your code implements it and returns the value 0 it is recommended
|
If your code implements it and returns the value 0 it is recommended
|
||||||
@@ -281,14 +281,14 @@ accident change the code.
|
|||||||
To be compatible means:
|
To be compatible means:
|
||||||
- the code associated with DHCP packet processing callouts e.g.
|
- the code associated with DHCP packet processing callouts e.g.
|
||||||
pkt4_receive or pkt6_send must be thread safe so the multi-threaded
|
pkt4_receive or pkt6_send must be thread safe so the multi-threaded
|
||||||
DHCP service can simultaneously calls more than once on of these callouts.
|
DHCP service can simultaneously call more than once one of these callouts.
|
||||||
- commands a library registers are not required to be thread safe because
|
- commands registered by a library are not required to be thread safe because
|
||||||
commands are executed by the main thread. Now it is a good idea to make
|
commands are executed by the main thread. Now it is a good idea to make
|
||||||
them thread safe and to document cases where they are not.
|
them thread safe and to document cases where they are not.
|
||||||
- when a library implements a thread safe backend API (e.g. host data
|
- when a library implements a thread safe backend API (e.g. host data
|
||||||
ource) the service methods must be thread safe.
|
source) the service methods must be thread safe.
|
||||||
- a library which modifies the internal configuration of the server,
|
- a library which modifies the internal configuration of the server,
|
||||||
e.g. create or delete a subnet, must enter a critical section using
|
e.g. creates or deletes a subnet, it must enter a critical section using
|
||||||
the @c isc::dhcp::MultiThreadingCriticalSection RAII class.
|
the @c isc::dhcp::MultiThreadingCriticalSection RAII class.
|
||||||
|
|
||||||
In the tutoral, we'll put "multi_threading_compatible" in its own file,
|
In the tutoral, we'll put "multi_threading_compatible" in its own file,
|
||||||
@@ -300,7 +300,7 @@ multi_threading_compatible.cc. The contents are:
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
||||||
int multi_threading_compatible() {
|
int multi_threading_compatible() {
|
||||||
return (0);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user