[Kea-users] Hook Development - Rust

Eric Graham eric.graham at vantagepnt.com
Fri Dec 9 16:14:09 UTC 2022


That's a good idea. At the very least, I can confirm whether the hook is expected to load if only implementing version(). According to the docs, I believe it to be so, but there's a lot there and I may be mistaken. I'll see what comes of it and post back here for future readers. If you or anyone else have more suggestions for now, please don't hesitate to share them. I can always work on the C++ PoC and the Rust hook at the same time.
________________________________
From: Kea-users <kea-users-bounces at lists.isc.org> on behalf of Darren Ankney <darren.ankney at gmail.com>
Sent: Friday, December 9, 2022 10:06 AM
To: kea-users at lists.isc.org <kea-users at lists.isc.org>
Subject: Re: [Kea-users] Hook Development - Rust

CAUTION: This email originated outside the organization. Do not click any links or attachments unless you have verified the sender.

maybe if you develop a simple hook that does something very simple in
c++ it will become more obvious how to do the same in Rust?

On Fri, Dec 9, 2022 at 11:01 AM Eric Graham <eric.graham at vantagepnt.com> wrote:
>
> Thanks for the link! I have gone through that page and the instructions are thorough. There are projects like CXX (https://cxx.rs/) that help with the Rust <--> C++ stuff, but to be honest, I am new to Rust (Python is one I'm more familiar with, but I am not interested in writing the hook in Python at this stage - speed https://stackoverflow.com/questions/801657/is-python-faster-and-lighter-than-c and type safety). I assume something is wrong with how I'm linking against Kea, but I don't know. Unfortunately, the debug log during hook loading is not terribly helpful. I am confident it's possible, though.
>
>
>
> ________________________________
> From: Darren Ankney <darren.ankney at gmail.com>
> Sent: Friday, December 9, 2022 9:49 AM
> To: Eric Graham <eric.graham at vantagepnt.com>
> Cc: kea-users at lists.isc.org <kea-users at lists.isc.org>
> Subject: Re: [Kea-users] Hook Development - Rust
>
> Apologies if you've already found this guide, but here is a link to
> the hook developers guide:
>
> https://reports.kea.isc.org/dev_guide/df/d46/hooksdgDevelopersGuide.html
>
> I'm not super familiar with rust myself (though I have played around
> with it) but you can't just include header files that were meant for
> 'c' or 'c++' right?  At least from what little i've done, it didn't
> seem so...  it seemed they had their own API and an application to
> search user created extensions for such.  The developer's guide I
> linked says it should be possible to create hooks in other languages.
> They mention Python.  I'd say Rust is way closer to C++ the Python
> is... so it should be possible?
>
> On Fri, Dec 9, 2022 at 10:32 AM Eric Graham <eric.graham at vantagepnt.com> wrote:
> >
> > Hi Darren,
> >
> > Thanks for the link! I actually have already done so, but for a few reasons (I believe it is slower than a hook, and it's limited) I would prefer to write a "native" one.
> >
> > I sure wish it would have been implemented differently, as something like gRPC + protobuf!
> >
> >
> > ________________________________
> > From: Darren Ankney <darren.ankney at gmail.com>
> > Sent: Thursday, December 8, 2022 7:34 PM
> > To: kea-users at lists.isc.org <kea-users at lists.isc.org>
> > Subject: Re: [Kea-users] Hook Development - Rust
> >
> > If nothing else, perhaps you could make use of the run_script hook:
> > https://kea.readthedocs.io/en/kea-2.2.0/arm/hooks.html#run-script-run-script-support-for-external-hook-scripts
> > You could probably write the "script" in whatever language you want,
> > including rust, or at least that's the way I interpret it.
> >
> > On Thu, Dec 8, 2022 at 2:16 PM Eric Graham <eric.graham at vantagepnt.com> wrote:
> > >
> > > Hello! First time using this / any mailing list, so critiques welcome.
> > >
> > > 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 its memory safety and speed. I have not had luck finding any Kea hook in Rust 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 implementing version(). Does anyone know of a hook even partially implemented in Rust, or have interest in doing so?
> > >
> > > Thank you,
> > > Eric
> > >
> > > If this email belongs in the dev list, please correct me. Thanks.
> > > This message is intended solely for the use of the individual and entity to whom it is addressed and may contain information that is privileged, confidential, and exempt from disclosure under applicable state and federal laws. If you are not the addressee or are not authorized to receive for the intended addressee you are hereby notified that you may not use, copy, distribute, or disclose to anyone this message or the information contained herein. If you have received this message in error, immediately advise the sender by reply email and destroy this message.
> > > --
> > > ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.
> > >
> > > To unsubscribe visit https://lists.isc.org/mailman/listinfo/kea-users.
> > >
> > > Kea-users mailing list
> > > Kea-users at lists.isc.org
> > > https://lists.isc.org/mailman/listinfo/kea-users
> >
> > --
> > ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.
> >
> > To unsubscribe visit https://lists.isc.org/mailman/listinfo/kea-users.
> >
> > Kea-users mailing list
> > Kea-users at lists.isc.org
> > https://lists.isc.org/mailman/listinfo/kea-users
>
--
ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.

To unsubscribe visit https://lists.isc.org/mailman/listinfo/kea-users.

Kea-users mailing list
Kea-users at lists.isc.org
https://lists.isc.org/mailman/listinfo/kea-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/kea-users/attachments/20221209/439754ee/attachment-0001.htm>


More information about the Kea-users mailing list