<div dir="ltr">Thanks Marcin. It worked</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 23, 2017 at 4:28 PM, Marcin Siodelski <span dir="ltr"><<a href="mailto:marcin@isc.org" target="_blank">marcin@isc.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You'd rather need to link with this:<br>
<br>
libdhcp_user_chk_la_LIBADD +=<br>
$(top_builddir)/src/lib/<wbr>dhcpsrv/<a href="http://libkea-dhcpsrv.la" rel="noreferrer" target="_blank">libkea-dhcpsrv.la</a><br>
<br>
In most cases you'd also need to link with <a href="http://libkea-dhcpsrv.la" rel="noreferrer" target="_blank">libkea-dhcpsrv.la</a><br>
dependencies which you can find it its Makefile.am.<br>
<br>
As for the automake error it seems to me that you're missing<br>
automake-1.14. Perhaps you have some different version? automake-1.15?<br>
<br>
Maybe go to Kea root directory and run autoreconf --install &&<br>
./configure ... && make<br>
<br>
again.<br>
<br>
Marcin<br>
<span class=""><br>
On 23.08.2017 12:41, Gokulakrishnan Gopalakrishnan wrote:<br>
> Thanks Marcin, I just did what you mentioned in the code and<br>
</span>> printed *iface_configuation-><wbr>str()* and it prints an empty array<br>
<span class="">> interface. Probably because I didn't link the hook user_chk<br>
</span>> with *libkea-dhcpsrv*. <br>
> I tried linking* **libkea-dhcpsrv *by adding <br>
><br>
> libdhcp_user_chk_la_LIBADD += $(top_builddir)/src/lib/hooks/<a href="http://libkea-dhcpsrv.la" rel="noreferrer" target="_blank"><wbr>libkea-dhcpsrv.la</a> <<a href="http://libkea-dhcpsrv.la" rel="noreferrer" target="_blank">http://libkea-dhcpsrv.la</a>><br>
<span class="im HOEnZb">><br>
> in src/hooks/dhcp/user_chk/<wbr>Makefile.am and did a make.<br>
><br>
> I'm getting automake-1.14: command not found. Every time editing<br>
> Makefile.am, I'm getting this error. Am I doing the linking correctly?<br>
> Am I missing something here? Please correct me if I'm wrong<br>
><br>
><br>
><br>
><br>
> On Wed, Aug 23, 2017 at 3:09 PM, Marcin Siodelski <<a href="mailto:marcin@isc.org">marcin@isc.org</a><br>
</span><div class="HOEnZb"><div class="h5">> <mailto:<a href="mailto:marcin@isc.org">marcin@isc.org</a>>> wrote:<br>
><br>
> On 23.08.2017 11:24, Gokulakrishnan Gopalakrishnan wrote:<br>
> > "interfaces-config": {<br>
> ><br>
> > "interfaces": [ "eth0" ]<br>
> ><br>
> > }<br>
> ><br>
> > Can we get the list of interface name in hooks code? In the example<br>
> > mentioned above, can we get the value "eth0" in hooks code in<br>
> > <int load(LibraryHandle&)> function?<br>
> ><br>
> ><br>
><br>
> To retrieve server configuration information you'd need to link your<br>
> hook library with libkea-dhcpsrv and do something like this:<br>
><br>
> #include <dhcpsrv/cfg_iface.h><br>
><br>
> ConstCfgIfacePtr cfg = <br>
> CfgMgr::instance().<wbr>getCurrentCfg()->getCfgIface()<wbr>;<br>
> ElementPtr iface_configuation = cfg->toElement();<br>
><br>
> The iface_configuration will now hold the conifguration structure you're<br>
> looking for.<br>
><br>
> Marcin Siodelski<br>
> ISC<br>
><br>
><br>
<br>
</div></div></blockquote></div><br></div>