Extract other leaf node from get-element operational call back

Hi,
I have a yang as below. Whenever client query for “replies-transmitted” against respective “interface” ,server need to respond.
I have added a call point “md-data-definitions” container. Now the problem is whenever get_element call back is getting called for “replies-transmitted” leaf node, not able to extract the “interface” leaf node details provided by the client in the get_element call back. Is there any way i can get it from confd_hkeypath_t * or anyother method through which i can get it will be really helpful.

+--rw md-data-definitions
 +--rw maintenance-domain* [id]
    +--rw id                         
    +--rw name?                      
    +--rw md-level?                  
    +--rw maintenance-association* [id]
       +--rw id                
       +--rw name?             
       +--rw component-list* [component-id]
          +--rw component-id                         
          +--rw name?                                
          +--rw vid*                                 
          +--rw remote-meps*                         
          +--rw maintenance-association-end-point* [mep-identifier]
             +--rw mep-identifier          
             +--rw interface               
             +--rw primary-vid             
             +--rw administrative-state    
             +--ro mac-address?            
             +--ro loopback
                +--ro replies-transmitted    

Regards,
Biswajit

That should be quite straightforward, you need the following:

  • have an open MAAPI socket
  • using maapi_attach, attach the socket to the user transaction
  • via MAAPI functions like maapi_get_elem or the like get the leaf value.

The hook example and the transform example are doing something very similiar, you may want to have a look at them.

Hi ,
I have subscribed confd_register_trans_cb & onfd_register_data_cb and provided call point at md-data-definitions.
Is there any way i can achieve through this without using maapi will be really helpful.

Regards,
Biswajit

I am afraid that using MAAPI is the only reasonable way. You can register a set- or or a transaction-hook on the leaf interface and get callback invocations when its value changes so that you can keep track of its value. With that, you are actually duplicating what ConfD’s CDB is already doing and I would advise against such approach. The problem I can immediately think of is that it may not be possible to know if the value seen in the last callback made it to the database; and the other way round, in some cases the hook callback is not necessarily invoked.