From: Razvan Becheriu Date: Mon, 15 Feb 2021 14:14:25 +0000 (+0200) Subject: [#899] added more documentation X-Git-Tag: Kea-1.9.5~67 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f544d4739260c8aff41e01382f89cb4b44b4fb5e;p=thirdparty%2Fkea.git [#899] added more documentation --- diff --git a/ChangeLog b/ChangeLog index 9879c32c42..19a86b7c61 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,7 @@ 1865. [func] razvan Implemented the Run Script hooks library which can be used to run external scripts for specific packet processing hook points. - There are several exported environemnt variables available for + There are several exported environment variables available for the script. Currently the implementation is nonblocking and Kea will not wait for the script to finish execution before continuing to the next step. For this reason, the next step diff --git a/doc/sphinx/arm/hooks-run-script.rst b/doc/sphinx/arm/hooks-run-script.rst index ae7a87b4f6..fb9bf1f969 100644 --- a/doc/sphinx/arm/hooks-run-script.rst +++ b/doc/sphinx/arm/hooks-run-script.rst @@ -3,7 +3,8 @@ Run Script Support ================== -This hooks library adds support for calling an external script with vendor information extensions +This hooks library adds support for calling an external script for specific +packet processing hook points. The library is available since Kea 1.9.5 and can be loaded in a similar way as other hook libraries by the ``kea-dhcp4`` and diff --git a/doc/sphinx/arm/hooks.rst b/doc/sphinx/arm/hooks.rst index 8ec4f42e48..7fb8435315 100644 --- a/doc/sphinx/arm/hooks.rst +++ b/doc/sphinx/arm/hooks.rst @@ -461,6 +461,11 @@ loaded by the correct process per the table below. | | 1.7.8, DHCPv6 | | | | since 1.7.9) | | +-----------------+---------------+------------------------------------------------------------+ + | Run Script | Kea sources |The Run Script hooks library adds support to run external | + | | (since 1.9.5) |scripts for specific packet processing hook points. There | + | | |are several exported environment variables available for | + | | |the script. | + +-----------------+---------------+------------------------------------------------------------+ ISC hopes to see more hooks libraries become available as time progresses, developed both internally and externally. Since this list diff --git a/src/hooks/dhcp/run_script/run_script.dox b/src/hooks/dhcp/run_script/run_script.dox index d2e714bcf9..bb29170c39 100644 --- a/src/hooks/dhcp/run_script/run_script.dox +++ b/src/hooks/dhcp/run_script/run_script.dox @@ -24,15 +24,16 @@ Developer's Guide and in particular its section about hooks. libdhcp_run_script is a hooks library which allows an external script to be run on specific hook points. -## Configuring the DHCPv4 Module +## Configuring the DHCPv4 and DHCPv6 Modules It must be configured as a hook library for the desired DHCP server modules. Note that the Run Script library is installed alongside the Kea libraries in "/lib" where is determined by the --prefix option of the configure script. It defaults to -"/usr/local". Assuming the default value then, configuring kea-dhcp4 -to load the Run Script library could be done with the following Kea4 -configuration: +"/usr/local". + +Configuring kea-dhcp4 to load the Run Script library could be done with +the following Kea4 configuration: @code "Dhcp4": { @@ -48,6 +49,23 @@ configuration: } @endcode +Configuring kea-dhcp6 to load the Run Script library could be done with +the following Kea6 configuration: + +@code +"Dhcp6": { + "hook_libraries": [ + { "library": "/usr/local/lib/libdhcp_run_script.so", + "parameters": { + "name": "/path_to/script_name.sh", + "sync": false + } + }, + ... + ] +} +@endcode + The parameters contain the 'name' which indicates the path and name of the external script to be called on each hookpoint, and also the 'sync' option to be able to wait synchronously for the script to finish execution.