[Kea-users] Hook Development - Rust

Francis Dupont fdupont at isc.org
Fri Dec 9 21:42:19 UTC 2022


Eric Graham writes:
> I am looking into the possibility of writing a Rust hook. I understand that=
>  using C++ is likely the simplest alternative, but Rust is attractive for i=
> ts memory safety and speed. I have not had luck finding any Kea hook in Rus=
> t to use as a starting point. The C FFI is a complicating factor. In fact, =
> I have not had luck getting a very basic PoC to register with Kea, just imp=
> lementing version(). Does anyone know of a hook even partially implemented =
> in Rust, or have interest in doing so?

=> I created a long time ago a fdxhook branch (which should be on github)
to experiment hooks written in various script languages (python, ocaml,
lua and v8). In fact as soon as you have interface from and to C or C++
it seems to be feasible. Of course you need to understand well the external
language memory management, in particular when you have a real garbage
collector. And you have to know how to embed programs written in this
external language into Kea, again it is something supported by script
languages and well documented...

Note there are some other examples of Kea hooks written in python (this is
attractive because python programs are easy to write). I do not know
for a "plain" language as rust or go: I am afraid you lost all benefits
from using them, i.e. C++ seems to be the only real candidate.

Thanks

Francis Dupont <fdupont at isc.org>


More information about the Kea-users mailing list