Marcin, When I placed the code in "load(LibraryHandle&), I'm getting empty interface list, whereas if I keep the code in another hook like pkt4_send, I'm getting the proper list of interfaces. Actually, I'd be needing this info while initializing the Kea Process itself. Can we get it somehow?
On Wed, Aug 23, 2017 at 8:02 PM, Gokulakrishnan Gopalakrishnan < ggopalakrish...@salesforce.com> wrote: > Thanks Marcin. It worked > > On Wed, Aug 23, 2017 at 4:28 PM, Marcin Siodelski <mar...@isc.org> wrote: > >> You'd rather need to link with this: >> >> libdhcp_user_chk_la_LIBADD += >> $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la >> >> In most cases you'd also need to link with libkea-dhcpsrv.la >> dependencies which you can find it its Makefile.am. >> >> As for the automake error it seems to me that you're missing >> automake-1.14. Perhaps you have some different version? automake-1.15? >> >> Maybe go to Kea root directory and run autoreconf --install && >> ./configure ... && make >> >> again. >> >> Marcin >> >> On 23.08.2017 12:41, Gokulakrishnan Gopalakrishnan wrote: >> > Thanks Marcin, I just did what you mentioned in the code and >> > printed *iface_configuation->str()* and it prints an empty array >> > interface. Probably because I didn't link the hook user_chk >> > with *libkea-dhcpsrv*. >> > I tried linking* **libkea-dhcpsrv *by adding >> > >> > libdhcp_user_chk_la_LIBADD += $(top_builddir)/src/lib/hooks/ >> libkea-dhcpsrv.la <http://libkea-dhcpsrv.la> >> > >> > in src/hooks/dhcp/user_chk/Makefile.am and did a make. >> > >> > I'm getting automake-1.14: command not found. Every time editing >> > Makefile.am, I'm getting this error. Am I doing the linking correctly? >> > Am I missing something here? Please correct me if I'm wrong >> > >> > >> > >> > >> > On Wed, Aug 23, 2017 at 3:09 PM, Marcin Siodelski <mar...@isc.org >> > <mailto:mar...@isc.org>> wrote: >> > >> > On 23.08.2017 11:24, Gokulakrishnan Gopalakrishnan wrote: >> > > "interfaces-config": { >> > > >> > > "interfaces": [ "eth0" ] >> > > >> > > } >> > > >> > > Can we get the list of interface name in hooks code? In the >> example >> > > mentioned above, can we get the value "eth0" in hooks code in >> > > <int load(LibraryHandle&)> function? >> > > >> > > >> > >> > To retrieve server configuration information you'd need to link your >> > hook library with libkea-dhcpsrv and do something like this: >> > >> > #include <dhcpsrv/cfg_iface.h> >> > >> > ConstCfgIfacePtr cfg = >> > CfgMgr::instance().getCurrentCfg()->getCfgIface(); >> > ElementPtr iface_configuation = cfg->toElement(); >> > >> > The iface_configuration will now hold the conifguration structure >> you're >> > looking for. >> > >> > Marcin Siodelski >> > ISC >> > >> > >> >> >
_______________________________________________ Kea-users mailing list Kea-users@lists.isc.org https://lists.isc.org/mailman/listinfo/kea-users