About Bind Plugin development
Chunhui Ouyang
jack9603301 at 163.com
Sat Nov 22 11:40:14 UTC 2025
Strangely, if I don't use config.h, I get a whole bunch of compilation errors, such as:
```
gcc -shared -fPIC -I /root/bind-project/lib/isc/include/ -I /root/bind-project/bind/lib/isccfg/include/ -I /root/bind-project/bind/lib/ns/include/ main.c -o filter-plugin.so
In file included from /usr/include/isc/quota.h:34,
from /root/bind-project/bind/lib/ns/include/ns/client.h:65,
from main.c:15:
/usr/include/isc/job.h:40:38: error: field ‘wfcq_node’ has incomplete type
40 | struct cds_wfcq_node wfcq_node;
| ^~~~~~~~~
In file included from /usr/include/isc/mutex.h:24,
from /usr/include/isc/mem.h:23,
from /usr/include/isc/buffer.h:112,
from main.c:5:
/usr/include/isc/quota.h:59:1: error: invalid application of ‘sizeof’ to incomplete type ‘struct __cds_wfcq_head’
59 | STATIC_ASSERT(ISC_OS_CACHELINE_SIZE >= sizeof(struct __cds_wfcq_head),
| ^~~~~~~~~~~~~
/usr/include/isc/quota.h:59:15: error: expression in static assertion is not an integer
59 | STATIC_ASSERT(ISC_OS_CACHELINE_SIZE >= sizeof(struct __cds_wfcq_head),
| ^~~~~~~~~~~~~~~~~~~~~
/usr/include/isc/quota.h:68:38: error: field ‘head’ has incomplete type
68 | struct cds_wfcq_head head;
| ^~~~
/usr/include/isc/quota.h:70:47: error: invalid application of ‘sizeof’ to incomplete type ‘struct __cds_wfcq_head’
70 | sizeof(struct __cds_wfcq_head)];
| ^~~~~~
/usr/include/isc/quota.h:71:38: error: field ‘tail’ has incomplete type
71 | struct cds_wfcq_tail tail;
| ^~~~
In file included from /root/bind-project/bind/lib/ns/include/ns/client.h:68:
/usr/include/dns/db.h:234:33: error: field ‘rcu_head’ has incomplete type
234 | struct rcu_head rcu_head;
| ^~~~~~~~
make: *** [Makefile:11: filter-plugin.so] Error 1
```
* Ondřej Surý <ondrej at isc.org> [2025-11-22 :32:13]:
> We don’t guidelines for out of tree plugins, but you should not need config.h from the build. The plugin just need to export the needed symbols.
>
> You can contribute these guidelines (or more plugin hooks if needed), this is open source after all…
>
> Ondrej
> --
> Ondřej Surý — ISC (He/Him)
>
> My working hours and your working hours may be different. Please do not feel obligated to reply outside your normal working hours.
>
> > On 22. 11. 2025, at 11:51, Chunhui Ouyang <jack9603301 at 163.com> wrote:
> >
> > Hello, could you provide a guide on how to organize the project structure for third-party plugin development? I've noticed that current compilation requires the already built bind9's config.h file, but this file doesn't exist in a brand new project. Does this mean it doesn't allow external compilation of the source code?
> >
> > Looking forward to your reply.
> >
> > * Colin Vidal <colin at isc.org> [2025-11-21 :14:06]:
> >
> >>> On Fri, 2025-11-21 at 23:29 +0800, Chunhui Ouyang wrote:
> >>> Could you tell me what the entry point of the plugin is?
> >>>
> >>
> >> As explained in the reference for plugin development I sent you
> >> earlier:
> >>
> >> "At various locations within the named source code, there are "hook
> >> points" at which a plugin may register itself. When a hook point is
> >> reached while named is running, it is checked to see whether any
> >> plugins have registered themselves there; if so, the associated "hook
> >> action" - a function within the plugin library - is called."
> >>
> >> So there is no really a single "entry" point, but rather multiples ones
> >> depending where the plugin is hooked. (Plus the four `plugin_*` API to
> >> implement for registering, etc.)
> >>
> >> Side note: please answer emails with the mailing list in CC, so
> >> everyone can see, benefit and contribute to this thread.
> >>
> >> Thanks
> >>
> >> Colin Vidal
> >>
> > --
> > Visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from this list.
> > <signature.asc>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.isc.org/pipermail/bind-users/attachments/20251122/d6c8b33c/attachment.sig>
More information about the bind-users
mailing list