ConfD User Community

How to identify NetConf operation during callback invocation?


Do we have any flag or ENUM available to identify which NetConf operation(get/get-config) invokes get_next_object callback, during get/get-config request transaction.

Thanks in advance.

In confd.conf turn on the auditLog and set the developer log level “trace”

  • look for “thandle” (= transaction handle/id) in the audit log for a netconf session that commit configuration.
  • The same transaction handle/id can be found in the developer log, called “tid”.
  • The data provider callback, e.g. get_next_object(), include the transaction handle/id
    For example for the C-API in the “struct confd_trans_ctx *tctx” parameter. tctx->thandle

Thanks for the response @cohult.

Do we have any parameter in “struct confd_trans_ctx * tctx” to identify which operation(get/get-config) invoked the callback.

Why would your data provider need to know if it’s a NETCONF get or a get-config?

If you need to know if the request is for config or state data, use two different callpoints, one that serves config true data and one that serves config false data only, there are several ways to do so. One way:

tailf:callpoint my-cp {
   tailf:config true;
   tailf:opaque "true";
tailf:callpoint my-cp {
   tailf:config false;
  tailf:opaque "false";

Then check the tctx->callpoint_opaque in the data provider callback.

To actually find out if the NETCONF RPC is a get or get-config (or a get-data call for config or state data), you could subscribe to CONFD_NOTIF_NETCONF events that will be received just before the callback is invoked.
In ConfD-7.5.1 a “trace-id” will be introduced to easier identify the NETCONF RPC in case there are many different reads running at parallel.