<div dir="ltr"><div>Hi all,</div><div><br></div>I must admit, I've never built a custom hook before, but wouldn't you need to make this part of the Kea source tree (as described for the premium hooks: <a href="https://kea.readthedocs.io/en/kea-2.2.0/arm/hooks.html#installing-hook-packages">https://kea.readthedocs.io/en/kea-2.2.0/arm/hooks.html#installing-hook-packages</a>) and recompile Kea with the hook? The developer's guide may be useful as well: <a href="https://reports.kea.isc.org/dev_guide/">https://reports.kea.isc.org/dev_guide/</a><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jun 22, 2023 at 10:31 AM Eric Graham <<a href="mailto:eric.graham@vantagepnt.com">eric.graham@vantagepnt.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg-7857980560845702015">




<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Ronald,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
That error is a catch-all for essentially any reason your hook isn't working cleanly. Maybe you're missing a function or have some other (syntactically valid) error. Also make sure that the permissions on the SO are correct, and that it's linking correctly
 if you didn't compile on the server. Can you provide us a minimal (non)working example?</div>
<div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div id="m_-7857980560845702015Signature">
<div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<b>Eric Graham</b></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<i>DevOps Specialist</i></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<span style="font-size:8pt">Direct: 605.990.1859</span><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:8pt;color:rgb(0,0,0);background-color:rgba(0,0,0,0)"></span><i><br>
</i></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<i><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:8pt;color:rgb(0,0,0);background-color:rgba(0,0,0,0)"></span></i><a href="mailto:eric.graham@vantagepnt.com" title="mailto:eric.graham@vantagepnt.com" target="_blank"><span style="font-size:8pt">Eric.Graham@vantagepnt.com</span></a><i><br>
</i></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<i><img style="max-width: 100%;" id="m_-7857980560845702015imageSelected0" src="cid:188e7f8d0c233a801ca1"><br>
</i></div>
</div>
</div>
</div>
<div id="m_-7857980560845702015appendonsend"></div>
<hr style="display:inline-block;width:98%">
<div id="m_-7857980560845702015divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Kea-users <<a href="mailto:kea-users-bounces@lists.isc.org" target="_blank">kea-users-bounces@lists.isc.org</a>> on behalf of DDFR | Ronald Blaas <<a href="mailto:ronald.blaas@ddfr.nl" target="_blank">ronald.blaas@ddfr.nl</a>><br>
<b>Sent:</b> Thursday, June 22, 2023 7:43 AM<br>
<b>To:</b> <a href="mailto:kea-users@lists.isc.org" target="_blank">kea-users@lists.isc.org</a> <<a href="mailto:kea-users@lists.isc.org" target="_blank">kea-users@lists.isc.org</a>><br>
<b>Subject:</b> [Kea-users] hooks libraries failed to validate</font>
<div> </div>
</div>

<div dir="ltr">
<div style="border-radius:15px;padding:3px 3px 3px 10px;font-size:9pt;font-family:Arial,sans-serif;color:rgb(255,255,255);background-color:rgb(23,53,91)">
<b>CAUTION:</b> This email originated outside the organization. Do not click any links or attachments unless you have verified the sender.
</div>
<div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Hi all,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Breaking my head over here. </div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Can't seem to figure out what I am missing here.</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Trying to create a custom hook. Using <a href="https://reports.kea.isc.org/dev_guide/df/d46/hooksdgDevelopersGuide.html#hooksdgTutorial" id="m_-7857980560845702015LPlnk960020" target="_blank">https://reports.kea.isc.org/dev_guide/df/d46/hooksdgDevelopersGuide.html#hooksdgTutorial</a> as an example. </div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
So I have created 5 files (version.cc / library_common.h / load_unload.cc / pkt_receive.cc / pkt_send.cc) </div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
compiled it </div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
g++ -I /usr/include/kea -L /usr/lib -fpic -shared -o test_hook.so load_unload.cc pkt_receive4.cc pkt_send.cc version.cc -lkea-dhcpsrv -lkea-dhcp++ -lkea-hooks -lkea-log -lkea-util -lkea-exceptions<br>
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
mv the "test_hook.so" to the Hooks dir for kea. </div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Edited the config file to include the hook.</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
But after restart of kea-dhcp4 services I see this error (and kea does not start)</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Jun 22 14:42:29 dhcp1 kea-dhcp4[81922]: 2023-06-22 14:42:29.237 ERROR [kea-dhcp4.dhcp4/81922.140261235613312] DHCP4_INIT_FAIL failed to initialize Kea server: configuration error using file '/etc/kea/kea-dhcp4.conf': hooks libraries failed to validate - library
 or libraries in error are: /usr/lib/x86_64-linux-gnu/kea/hooks/test_hook.so (/etc/kea/kea-dhcp4.conf:25:5)<br>
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
So where did I go wrong? </div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Regards</div>
</div>
</div>
</div>

-- <br>
ISC funds the development of this software with paid support subscriptions. Contact us at <a href="https://www.isc.org/contact/" rel="noreferrer" target="_blank">https://www.isc.org/contact/</a> for more information.<br>
<br>
To unsubscribe visit <a href="https://lists.isc.org/mailman/listinfo/kea-users" rel="noreferrer" target="_blank">https://lists.isc.org/mailman/listinfo/kea-users</a>.<br>
<br>
Kea-users mailing list<br>
<a href="mailto:Kea-users@lists.isc.org" target="_blank">Kea-users@lists.isc.org</a><br>
<a href="https://lists.isc.org/mailman/listinfo/kea-users" rel="noreferrer" target="_blank">https://lists.isc.org/mailman/listinfo/kea-users</a><br>
</div></blockquote></div>