# User callback registration

**URL:** <https://dmap-community.ductus.global/t/user-callback-registration/3779>\
**Category:** CDB and CDB API\
**Created:** [August 17, 2021, 9:27am UTC](https://dmap-community.ductus.global/t/user-callback-registration/3779 "2021-08-17T09:27:43Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![bkumar](https://avatars.discourse-cdn.com/v4/letter/b/6bbea6/32.png) [@bkumar](https://dmap-community.ductus.global/u/bkumar)\
**Post date:** [August 17, 2021, 9:27am UTC](https://dmap-community.ductus.global/t/user-callback-registration/3779/1 "2021-08-17T09:27:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)\
**Post date:** [August 17, 2021, 10:21am UTC](https://dmap-community.ductus.global/t/user-callback-registration/3779/2 "2021-08-17T10:21:02Z")

</div>

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`

---

<div class="post-metadata">

**Author:** ![bkumar](https://avatars.discourse-cdn.com/v4/letter/b/6bbea6/32.png) [@bkumar](https://dmap-community.ductus.global/u/bkumar)\
**Post date:** [August 17, 2021, 10:46am UTC](https://dmap-community.ductus.global/t/user-callback-registration/3779/3 "2021-08-17T10:46:24Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)\
**Post date:** [August 17, 2021, 3:06pm UTC](https://dmap-community.ductus.global/t/user-callback-registration/3779/4 "2021-08-17T15:06:00Z")

</div>

Hi,

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

> **[ConfD Evaluation Kick Start Guide](https://info.tail-f.com/confd-evaluation-kick-start-guide)**
>
> The ConfD Kick Start Guide is a practical guide to understanding the ConfD data model driven management plane framework as well as ConfD's architectural principles and how it fits in with the surrounding world.

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

---

<div class="post-metadata">

**Author:** ![bkumar](https://avatars.discourse-cdn.com/v4/letter/b/6bbea6/32.png) [@bkumar](https://dmap-community.ductus.global/u/bkumar)\
**Post date:** [August 17, 2021, 3:18pm UTC](https://dmap-community.ductus.global/t/user-callback-registration/3779/5 "2021-08-17T15:18:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bkumar](https://avatars.discourse-cdn.com/v4/letter/b/6bbea6/32.png) [@bkumar](https://dmap-community.ductus.global/u/bkumar)\
**Post date:** [August 18, 2021, 6:07am UTC](https://dmap-community.ductus.global/t/user-callback-registration/3779/7 "2021-08-18T06:07:19Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![josephm](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@josephm](https://dmap-community.ductus.global/u/josephm)\
**Post date:** [August 18, 2021, 9:40am UTC](https://dmap-community.ductus.global/t/user-callback-registration/3779/8 "2021-08-18T09:40:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![bkumar](https://avatars.discourse-cdn.com/v4/letter/b/6bbea6/32.png) [@bkumar](https://dmap-community.ductus.global/u/bkumar)\
**Post date:** [August 18, 2021, 10:10am UTC](https://dmap-community.ductus.global/t/user-callback-registration/3779/9 "2021-08-18T10:10:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)\
**Post date:** [August 18, 2021, 10:24am UTC](https://dmap-community.ductus.global/t/user-callback-registration/3779/10 "2021-08-18T10:24:24Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![bkumar](https://avatars.discourse-cdn.com/v4/letter/b/6bbea6/32.png) [@bkumar](https://dmap-community.ductus.global/u/bkumar)\
**Post date:** [August 18, 2021, 12:39pm UTC](https://dmap-community.ductus.global/t/user-callback-registration/3779/11 "2021-08-18T12:39:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bkumar](https://avatars.discourse-cdn.com/v4/letter/b/6bbea6/32.png) [@bkumar](https://dmap-community.ductus.global/u/bkumar)\
**Post date:** [August 19, 2021, 3:39am UTC](https://dmap-community.ductus.global/t/user-callback-registration/3779/12 "2021-08-19T03:39:07Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![bkumar](https://avatars.discourse-cdn.com/v4/letter/b/6bbea6/32.png) [@bkumar](https://dmap-community.ductus.global/u/bkumar)\
**Post date:** [August 19, 2021, 11:22am UTC](https://dmap-community.ductus.global/t/user-callback-registration/3779/13 "2021-08-19T11:22:21Z")

</div>

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 ?
