[bind10-dev] hooks in recursive server processing
Michal 'vorner' Vaner
michal.vaner at nic.cz
Fri Jan 21 14:04:26 UTC 2011
Hello
On Fri, Jan 21, 2011 at 11:24:24AM +0000, Stephen Morris wrote:
> For performance reasons, I don't think these could be done by external modules. The way I was thinking of would be to load a dynamic library at run-time. So we supply a default library in the distribution directory, each function comprising nothing more than a return statement. This is loaded at run-time unless a configuration option is set, in which case we load a user-supplied one. (As Michal pointed out, we might want to enable this feature by a compile-time option to avoid the overhead of calling empty functions.)
Well, this has two problems. One is you can have only one callback. Then you
can't combine the hooks together. Another is, call to dynamic library is more
expensive (though not by much), so having an empty function in different library
seems odd.
If I was to design a callback system, I would have a list/chain of functions to be
called at given point of execution. Each function could modify the ongoing
packet (or, whatever was there) and return status (pass to next function, abort,
say it is handled). Then the „usual“ behaviour would be just the only one in
default list. If we want an extension, a library would be loaded and it would
add its own functions to the front of whatever lists it would like, intercepting
all places it is interested in. So it could effectively modify the packets,
handle them itself in a different ways, abort the whole process, count
statistics, completely replace the logic, etc. And the only think it would
require from us is to split the logic in parts, decide interfaces and have a
template for the chained call. It seems simpler (or, at last, equally simple)
and more powerful.
Of course, this is just unfinished, unpolished, idea.
What do you think about it?
Have a nice day
--
The cost of living is going up, and the chance of living is going down.
Michal 'vorner' Vaner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <https://lists.isc.org/pipermail/bind10-dev/attachments/20110121/269f52c3/attachment.bin>
More information about the bind10-dev
mailing list