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
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
| | 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
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 "<install-dir>/lib" where <install-dir> 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": {
}
@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.