]> git.ipfire.org Git - thirdparty/bind9.git/commit
enable modules to store data in qctx
authorEvan Hunt <each@isc.org>
Mon, 13 Aug 2018 08:18:09 +0000 (01:18 -0700)
committerEvan Hunt <each@isc.org>
Thu, 6 Dec 2018 18:29:11 +0000 (10:29 -0800)
commit81f58e2ea2640bd010ddc8f5e0dca0740455966b
treeae2ef7ab6b173234283e064f92c597bd34c45ce9
parent9911c835d33ee263e1b147d48dc9cc0f5bdd1286
enable modules to store data in qctx

- added a 'hookdata' array to qctx to store pointers to up to
  16 blobs of data which are allocated by modules as needed.
  each module is assigned an ID number as it's loaded, and this
  is the index into the hook data array. this is to be used for
  holding persistent state between calls to a hook module for a
  specific query.
- instead of using qctx->filter_aaaa, we now use qctx->hookdata.
  (this was the last piece of filter-aaaa specific code outside the
  module.)
- added hook points for qctx initialization and destruction. we get
  a filter-aaaa data pointer from the mempool when initializing and
  store it in the qctx->hookdata table; return to to the mempool
  when destroying the qctx.
- link the view to the qctx so that detaching the client doesn't cause
  hooks to fail
- added a qctx_destroy() function which must be called after qctx_init;
  this calls the QCTX_DESTROY hook and detaches the view
- general cleanup and comments
12 files changed:
bin/hooks/filter-aaaa.c
bin/named/server.c
doc/misc/options
lib/dns/include/dns/types.h
lib/ns/client.c
lib/ns/hooks.c
lib/ns/include/ns/client.h
lib/ns/include/ns/hooks.h
lib/ns/include/ns/query.h
lib/ns/query.c
lib/ns/tests/nstest.c
win32utils/Configure