<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
hi all </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
I am trying to understand why my hook will not work.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
I am reading the tutorial that is given on the development pages but still no luck. </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
So now I am trying to make a real small hook (which does not do anything) </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Here is my test file</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<div class="ContentPasted0">#include <config.h></div>
<div class="ContentPasted0">#include <hooks/hooks.h></div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">extern "C" {</div>
<div><br class="ContentPasted0">
</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><br class="ContentPasted0">
</div>
<div class="ContentPasted0">}</div>
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
I compiled this using:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof ContentPasted1 ContentPasted2 ContentPasted3">
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<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof ContentPasted1 ContentPasted2 ContentPasted3">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof ContentPasted1 ContentPasted2 ContentPasted3">
after loading this hook kea-dhcp does not start. </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof ContentPasted1 ContentPasted2 ContentPasted3">
error: </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof ContentPasted1 ContentPasted2 ContentPasted3 ContentPasted4">
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 style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof ContentPasted1 ContentPasted2 ContentPasted3 ContentPasted4">
My kea-dhcp4.conf:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof ContentPasted1 ContentPasted2 ContentPasted3 ContentPasted4 ContentPasted5">
"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>
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof ContentPasted1 ContentPasted2 ContentPasted3 ContentPasted4 ContentPasted5">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof ContentPasted1 ContentPasted2 ContentPasted3 ContentPasted4 ContentPasted5">
Any insights are appreciated.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof ContentPasted1 ContentPasted2 ContentPasted3 ContentPasted4 ContentPasted5">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof ContentPasted1 ContentPasted2 ContentPasted3 ContentPasted4 ContentPasted5">
Regards</div>
</body>
</html>