Commit Graph

21 Commits

Author SHA1 Message Date
W.C.A. Wijngaards
a335e601e4 ipset-pf-support, move startup and destartup to the front of the module
func block functions, modstack call deinit function names, and detect
module change when no startup functions are needed.
2024-07-03 13:53:44 +02:00
W.C.A. Wijngaards
ff653a7ef8 Call module init init again, and new function startup and destartup.
NULL can be used if the function is not used. Open shared ports during
reload. Deinit is called during reload.
2024-07-01 16:10:07 +02:00
W.C.A. Wijngaards
31218166fc - Fix to remove two c99 notations. 2023-09-15 13:30:30 +02:00
W.C.A. Wijngaards
4613d2bf04 - Fix for #93: dynlibmodule import library is named libunbound.dll.a. 2021-01-14 16:50:17 +01:00
W.C.A. Wijngaards
3e03e2c26d - For #391: use struct timeval* start_time for callback information. 2021-01-08 09:47:46 +01:00
Frank Riley
e3abd772f7 Add start_time to reply callbacks so modules can compute the response time. 2021-01-01 15:44:21 -07:00
W.C.A. Wijngaards
811cf6db0c - Fix missing prototypes in the code. 2020-12-11 14:34:39 +01:00
W.C.A. Wijngaards
1175269bbd - Error message is logged for dynlibmod malloc failures. 2020-09-21 10:20:10 +02:00
L. Merino
41ab788cab fix: avoid leaking cb_pair in inplace_cb_register_wrapped() 2020-09-19 09:58:38 +02:00
L. Merino
56e0e5b9af fix: return error when malloc fails in inplace_cb_register_wrapped() 2020-09-19 09:58:32 +02:00
W.C.A. Wijngaards
2a90e8fa1e - doxygen file comments for dynlibmodule. 2020-06-24 13:37:43 +02:00
W.C.A. Wijngaards
711c0548f0 - For PR #93: windows compile warnings removal
- windows compile warnings removal for ip dscp option code.
2020-05-19 14:36:57 +02:00
W.C.A. Wijngaards
01db6c365c - For PR #93: dynlibmod can handle reloads and deinit and inits again,
with dlclose and dlopen of the library again.  Also for multiple
  modules.  Fix memory leak by not closing dlopened content.  Fix
  to allow one dynlibmod instance by unbound-checkconf.
2020-05-18 10:11:16 +02:00
W.C.A. Wijngaards
510e79a053 - For PR #93: Fix warnings for dynlibmodule. 2020-05-15 16:42:45 +02:00
PMunch
8802509a61 Fix return code of init to mirror native modules
The return code of the init procedure was just set to be 1 in the
dynamic library loading module. This ha been rectified and it will now
return whatever is returned from the loaded module.
2019-11-20 15:13:57 +01:00
PMunch
5eabc429bc Add "dynlib" prefix to example output, log queries
This adds the "dynlib: " prefix to all messages created by the
`helloworld.c` dynamic library example.

It also adds logging of queries that pass through `operate`.
2019-11-04 16:03:04 +01:00
PMunch
d104d3be22 Add inplace callback to dynlibmod, improve example
This adds the possibility to properly register inplace callbacks in the
dynamic library module. It works by creating a wrapper procedure that
is available to the dynamic library and will call the given callback
through a whitelisted callback function.

The dynamic library example has already been improved to include
comments and some simple examples on allocating and deallocating memory
and registering callbacks.
2019-11-01 10:44:26 +01:00
PMunch
f79811435b Cleanup some minor things in dynlibmod 2019-10-22 08:42:00 +02:00
PMunch
f177dc974c Add support for multiple dynamic modules
Allows the use of multiple dynamic modules. Simply add more "dynlib"
entries to the "modules-config" and the same amount of "dynlib-file"
entries in the dynlib configuration block.
2019-10-21 15:59:53 +02:00
PMunch
8eeb910e3d Improve dynlib module and add documentation
Dynamic library module is now only a thin wrapper that loads dynamic
libraries and forwards all function calls directly to the loaded module.
This meant adding get_mem and clear, and get_mem calls have been added
in the expected places.

Documentation has also been added to the example.conf and the
unbound.conf manpage.
2019-10-21 14:20:33 +02:00
PMunch
1762437121 Add dynamic library support 2019-10-21 09:34:51 +02:00