User callback registration

Hello All,
I have my simple yang module ,having one leaf(uint8 type) . I Want to register a simple callback for that whenever any changes happens in that leaf my callback should be invoke ,
Please provide me the steps to do that.
Thanks in advance

Hello,

You do not use callbacks for getting config change updates unless you implement an external database.
You typically utilize ConfD’s built in configuration data base (CDB) and use CDB subscriptions to get the config changes.
See ConfD UG chapter “CDB subscriptions” and the ConfD examples under examples.confd/cdb_subscription

Hi @cohult
Thanks for quick response.So where Should we write application code (in which directory) and how to compile the code (containing all API related to CDB)

Hi,

I recommend the ConfD Kick Start Guide Chapter 3 to get you started.

Chapter 3 of the kick start guide use the very basic examples.confd/intro/1-2-3-start-query-model example as a reference.

Hi @cohult
I took reference from this example already…but not understood about where We need to write a new application and how they will compiled

Hi @cohult
Is there any way to get previous set value of yang leaf and please let me know where I can found the CDB datastore (location directory)

you can use “oldv” argument of your CDB change iteration procedure… see existing examples in confd that use “cdb_diff_iterate(...)” to obtain leaf value that is being changed…

e.g. in examples.confd/cdb_subscription/twophase/twophase.c you can see old/new value being printed on line 53 (same principle applies to simple subscriber.

In other example examples.confd/cdb_subscription/iter_c/cdbl.c, oldv it is just ignored/not used, but can be utilized in same way, inside iter(...) procedure starting at line 121.

Thanks @josephm
Can you please explain that how confd is differ/better from netopeer2

Perhaps there are some members of this forum that are both netopeer2 and ConfD experts that can answer your question (I do not have enough netopeer2 experience).

But if you are choosing between solutions for enabling NETCONF only with your project, I suggest you try both solutions and make the “differ/better” comparison yourself to enable an intelligent decision for what is best for you. Feel free to add your findings here.

Tail-f welcomes other NETCONF enabling projects such as netopeer2 that enhances the NETCONF community support as that is one of the main goals of the Tail-f ConfD Basic project and ConfD product.

Thanks @cohult
Does confd server crashes due to errors(and crashes )in applications ?

Is there any ways to use callback function created using yumapro sdk(SIL development ) in confd ?
OR
confd can generate user callback function using Yang module?

Hi All
Please answer my below question who has worked on both netopeer2 and confd
what is basic difference between confd and netopeer2 ,which is better ?