Get_object callback support for SNMP MIB yang

For SNMP MIB yang(non-configuration), I implemented both get_elem() and get_object() callbacks.
Only get_elem() is invoked by ConfD.
Even if get_elem() callback is not present, get_object() is not invoked and the following error is seen in the confd log.

21-Jun-2018::04:39:48.880 fujitsu confd[2730]: devel-c get_elem error {proto_usage, “No get_elem() callback installed”} for callpoint ‘GeneralGroup-snmp’ path /PROTOCOL_MIB:PROTOCOL-MIB/GeneralGroup/GroupId
21-Jun-2018::04:39:48.880 fujitsu confd[2730]: devel-snmpa error: variable get: GroupId http://tail-f.com/ns/mibs/PROTOCOL-MIB/200611100000Z /PROTOCOL-MIB/GeneralGroup/GroupId

Please let us know if there is any restriction in ConfD not to invoke get_object() callback if callpoint is from SNMP MIB yang.

There is no such restriction, ConfD will always invoke get_object() if it is registered and get_elem() is not (if both are registered, I believe the logic for SNMP will indeed always choose get_elem() since it’s actually preferable due to the way SNMP managers typically traverse tables).

But the error you see is very strange - it indicates that at the point of registration, you had a non-NULL value for confd_data_cbs.get_elem, but at invocation, it is actually NULL. Is it possible that your application code modifies the struct after registration? confd_register_data_cb() saves a copy of the struct you pass in, but the copy it’s actually accessible for the application via confd_daemon_ctx.data_cbs if it disregards the “ConfD internal fields” comment in the declaration…