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 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 <[email protected]> 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 [email protected] https://lists.isc.org/mailman/listinfo/kea-users
