ConfD User Community

Confd with Netconf


Hi Team,

I am new to confd. Could you please explain how i can use confd as netconf server.

I am able to install confd and running confd.

From remote machine i am able to connect the confd netconf server and when i am able to do edit config on the candidate DB.

Below are my Questions and need your inputs
i am planning to add new yang file and able to store the yang file in yang directory and .fxs file in confd directory.

how to generate the corresponding C code to apply the config and in which location i have to copy the source code.

I tried understanding the examples, but not able to get clear idea.

Please do provide your inputs on things that we need to take care for adding new yang and applying the yang config on the device.

Thanks a lot for your help in advance.



ConfD provides a programmatic model rather than a code generation model. The need for code generation is low in the case of ConfD’s model driven approach. The auto-generated code portion as provided by some of the frameworks are already being provided by ConfD in its core engine.

This means that ConfD takes the compiled YANG model and automatically generate northbound interfaces and data base schemas for the data model. Your application then interact with configuration and operational state data through a powerful set of APIs which allows you to read and subscribe to changes of configuration data from CDB.

The best way to start learning how this works is to study Chapter 5. CDB - The ConfD XML Database in the Users Guide (especially Section 5.13. The full dhcpd example) and the intro/1-2-3-start-query-model example (the accompanying example code).

On a high level, what is going on in that example is:

  • Initialize the confd library
  • Create the socket used to subscribe for configuration changes from CDB
  • Set up a subscription for configuration changes to your YANG model
  • Read the initial configuration
  • Enter an infinite loop and wait for ConfD to notify you of changes and, when a change happens read the updated data from CDB