Re: About Bind Plugin development
Chunhui Ouyang <[email protected]> Sat, 22 Nov 2025 19:40:14 +0800
| Newsgroups | gmane.network.dns.bind.user |
|---|---|
| Message-ID | <aSGhHi8SeaIxIeAf@JACK-PC> |
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ý <[email protected]> [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 <[email protected]> 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 <[email protected]> [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>
>
--
Visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from this list.
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEE3jbn5J6NaSLTgdv31rEXC79Nm0FAmkhoR4ACgkQ31rEXC79 Nm1iIQ//WzZDCO5/pb9fQF5wPXSUueFwo0otH7JHgtHPX9Jg4iUY6V0kdHOp3GQi Xp3Ds0GeczIHoRwlowZAIX1FZd/a839z8eOvIkMTgqRwxYJ9tJsItltBnjFWa7vY h54SmhQCLggFyIYHQX3MEDq8gLK8T62rKT+8Lh+xAQ8rLWEZnedXwJEEyumOiSA2 kyl3wqDLXaN4KX7h7HJAyWzamVYsrJn9LDru9cl8Rt/8pdtKWVCwkWQXU6Lc/yVT hS27QGaoS41RBHmgteLkQBD0MedFiL0EkC3K2hZ+tDIiKtswa+MHEPb94USO6Z/A 6kjt9RGbvMVJaVfMCAWGCnHa94V1bW6NXZovxy5+pK2hBLO4bEA4eliiQp+JCSRD v/s5A0Q6LB/kFD7RBJ7NuEFUuwBpO+7YsoS12iaRN46lLOaFvjxh+oHlyK+918R6 XkIsY4gHCBTT2BWac9lcTkW4dslmuKM4MMaQQDTKjsfotQNtb6/hojLuUXnKRu8R j8fvFR8X7ZV4E75OLYYbiQbeBTVgVCPVFc+1pwL8n0dXlJVEhO3sjkfL1EK05Q4w 1KDnkExZN6EZ8A9j3RLwdhkSfd6KCRy30LOsy5vRwHxWAA9mBXq+0JHufytHmeA1 1T3ZVzmcV/vd5JfEeLVxvZZMxDxXd5KKpRlmUnhLre30LJbFjrc= =u4KK -----END PGP SIGNATURE-----