<html><body><div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; color: rgb(0, 0, 0);"><div> </div>
<div>Hi,</div>
<div> </div>
<div>Do you have multi-threading enabled in kea (now defaul is yes)?</div>
<div> </div>
<div>If so, please add multi threading compatibility to your library:</div>
<div> </div>
<div>______________________________________________________</div>
<div>
<div class="gl-display-flex">
<div>/// @brief This function is called to retrieve the multi-threading compatibility.</div>
<div>///</div>
<div>/// @return 1 which means compatible with multi-threading.</div>
<div>
<div>int multi_threading_compatible() {</div>
<div>    return (1);</div>
<div>}</div>
<div><span style="font-family: monospace, monospace; font-size: 1em; -webkit-text-size-adjust: 100%;"> </span><span style="font-family: monospace, monospace; font-size: 1em; -webkit-text-size-adjust: 100%;">______________________________________________________</span></div>
<div><span style="font-family: monospace, monospace; font-size: 1em; -webkit-text-size-adjust: 100%;"> </span></div>
<div><span style="font-family: monospace, monospace; font-size: 1em; -webkit-text-size-adjust: 100%;">Regards,</span></div>
<div><span style="font-family: monospace, monospace; font-size: 1em; -webkit-text-size-adjust: 100%;"> </span></div>
<div><span style="font-family: monospace, monospace; font-size: 1em; -webkit-text-size-adjust: 100%;">Razvan</span></div>
</div>
<pre class="gl-p-0! gl-w-full gl-overflow-visible! gl-border-none! code highlight gl-line-height-0"> </pre>
<div>
<div>
<div>
<div class="gl-display-flex">
<pre class="gl-p-0! gl-w-full gl-overflow-visible! gl-border-none! code highlight gl-line-height-0"> </pre>
<div> </div>
</div>
</div>
</div>
</div>
<pre class="gl-p-0! gl-w-full gl-overflow-visible! gl-border-none! code highlight gl-line-height-0"><code><span id="LC207" class="line" lang="cpp" data-testid="content"></span></code></pre>
</div>
</div>
<div id="signature-content-no-signature" data-marker="__SIG_PRE__"></div>
<div>

<div id="OLK_SRC_BODY_SECTION">
<div id="OLK_SRC_BODY_SECTION">
<blockquote style="margin: 0 0 0 .8em; border-left: 1px #ccc solid; padding-left: 1em;"><hr id="MESSAGE_DATA_MARKER"><strong>From: </strong>DDFR <ronald.blaas@ddfr.nl><br><strong>To: </strong>kea-users <kea-users@lists.isc.org><br><strong>Date: </strong>Monday, 26 June 2023 10:56 AM EEST<br><strong>Subject: </strong>[Kea-users] Hook failed to validate?<br><br>
<div class="elementToProof" style="font-family: 'calibri' , 'arial' , 'helvetica' , sans-serif; font-size: 12pt; color: #000000;">hi all </div>
<div class="elementToProof" style="font-family: 'calibri' , 'arial' , 'helvetica' , sans-serif; font-size: 12pt; color: #000000;"> </div>
<div class="elementToProof" style="font-family: 'calibri' , 'arial' , 'helvetica' , sans-serif; font-size: 12pt; color: #000000;">I am trying to understand why my hook will not work.</div>
<div class="elementToProof" style="font-family: 'calibri' , 'arial' , 'helvetica' , sans-serif; font-size: 12pt; color: #000000;"> </div>
<div class="elementToProof" style="font-family: 'calibri' , 'arial' , 'helvetica' , sans-serif; font-size: 12pt; color: #000000;">I am reading the tutorial that is given on the development pages but still no luck. </div>
<div class="elementToProof" style="font-family: 'calibri' , 'arial' , 'helvetica' , sans-serif; font-size: 12pt; color: #000000;"> </div>
<div class="elementToProof" style="font-family: 'calibri' , 'arial' , 'helvetica' , sans-serif; font-size: 12pt; color: #000000;">So now I am trying to make a real small hook (which does not do anything) </div>
<div class="elementToProof" style="font-family: 'calibri' , 'arial' , 'helvetica' , sans-serif; font-size: 12pt; color: #000000;"> </div>
<div class="elementToProof" style="font-family: 'calibri' , 'arial' , 'helvetica' , sans-serif; font-size: 12pt; color: #000000;">Here is my test file</div>
<div class="elementToProof" style="font-family: 'calibri' , 'arial' , 'helvetica' , sans-serif; font-size: 12pt; color: #000000;"> </div>
<div class="elementToProof" style="font-family: 'calibri' , 'arial' , 'helvetica' , sans-serif; font-size: 12pt; color: #000000;">
<div class="ContentPasted0">#include <config.h></div>
<div class="ContentPasted0">#include <hooks/hooks.h></div>
<div> </div>
<div class="ContentPasted0">extern "C" {</div>
<div> </div>
<div class="ContentPasted0">/// @brief returns Kea hooks version.</div>
<div class="ContentPasted0">int version() {</div>
<div class="ContentPasted0">    return (KEA_HOOKS_VERSION);</div>
<div class="ContentPasted0">}</div>
<div> </div>
<div class="ContentPasted0">}</div>
</div>
<div class="elementToProof" style="font-family: 'calibri' , 'arial' , 'helvetica' , sans-serif; font-size: 12pt; color: #000000;">I compiled this using:</div>
<div class="elementToProof ContentPasted1 ContentPasted2 ContentPasted3" style="font-family: 'calibri' , 'arial' , 'helvetica' , sans-serif; font-size: 12pt; color: #000000;">g++ -I /usr/include/kea -L /usr/lib -fpic -shared -lkea-dhcpsrv -lkea-dhcp++ -lkea-hooks -lkea-log -lkea-util -lkea-exceptions -o circuit_id.so version.cc</div>
<div class="elementToProof ContentPasted1 ContentPasted2 ContentPasted3" style="font-family: 'calibri' , 'arial' , 'helvetica' , sans-serif; font-size: 12pt; color: #000000;"> </div>
<div class="elementToProof ContentPasted1 ContentPasted2 ContentPasted3" style="font-family: 'calibri' , 'arial' , 'helvetica' , sans-serif; font-size: 12pt; color: #000000;">after loading this hook kea-dhcp does not start. </div>
<div class="elementToProof ContentPasted1 ContentPasted2 ContentPasted3" style="font-family: 'calibri' , 'arial' , 'helvetica' , sans-serif; font-size: 12pt; color: #000000;">error: </div>
<div class="elementToProof ContentPasted1 ContentPasted2 ContentPasted3 ContentPasted4" style="font-family: 'calibri' , 'arial' , 'helvetica' , sans-serif; font-size: 12pt; color: #000000;"> kea-dhcp4[22322]: 2023-06-26 07:50:35.752 ERROR [kea-dhcp4.dhcp4/22322.140007709609600] 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/circuit_id.so (/etc/kea/kea-dhcp4.conf:25:5)<br class="ContentPasted4"><br></div>
<div class="elementToProof ContentPasted1 ContentPasted2 ContentPasted3 ContentPasted4" style="font-family: 'calibri' , 'arial' , 'helvetica' , sans-serif; font-size: 12pt; color: #000000;">My kea-dhcp4.conf:</div>
<div class="elementToProof ContentPasted1 ContentPasted2 ContentPasted3 ContentPasted4 ContentPasted5" style="font-family: 'calibri' , 'arial' , 'helvetica' , sans-serif; font-size: 12pt; color: #000000;"> "hooks-libraries": [
<div class="ContentPasted5">        {</div>
<div class="ContentPasted5">            "library": "/usr/lib/x86_64-linux-gnu/kea/hooks/circuit_id.so"</div>
<div class="ContentPasted5">        }</div>
<div class="ContentPasted5">    ],</div>
</div>
<div class="elementToProof ContentPasted1 ContentPasted2 ContentPasted3 ContentPasted4 ContentPasted5" style="font-family: 'calibri' , 'arial' , 'helvetica' , sans-serif; font-size: 12pt; color: #000000;"> </div>
<div class="elementToProof ContentPasted1 ContentPasted2 ContentPasted3 ContentPasted4 ContentPasted5" style="font-family: 'calibri' , 'arial' , 'helvetica' , sans-serif; font-size: 12pt; color: #000000;">Any insights are appreciated.</div>
<div class="elementToProof ContentPasted1 ContentPasted2 ContentPasted3 ContentPasted4 ContentPasted5" style="font-family: 'calibri' , 'arial' , 'helvetica' , sans-serif; font-size: 12pt; color: #000000;"> </div>
<div class="elementToProof ContentPasted1 ContentPasted2 ContentPasted3 ContentPasted4 ContentPasted5" style="font-family: 'calibri' , 'arial' , 'helvetica' , sans-serif; font-size: 12pt; color: #000000;">Regards</div>
</blockquote>
</div>
</div></div></div></body></html>