> ConstElementPtr pool4_ctx;
> pool4_ctx = pool4_ptr->getContext(); // <-- this NOT working
=> either you check pool4_ptr before and it returns null or you
do not check and it crashes.
> can some one advise how to read user-context at the pool level ?
=> you need to get the address from the lease and use the getPool method
on the subnet to find what pool the address is from (note that getPool
interface was designed for allocation so the type is Lease::TYPE_V4 and
the anypool to false (critical as it defaults to true).
PS: the main reason pools are not saved in leases nor get their own
statistics is a pool is a bit hard to identify. If you have an idea
for a code and user friendly way to identify a pool please submit it.
ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.