Yes, the Data Provider API requires a daemon context. See the confd_lib_dp(3) man page confd_init_daemon() function.
You don’t necessarily need a MAAPI socket. If you look at what the Management Agent API (MAAPI) is used for in that example it is for doing a maapi_diff_iterate() and reading the new data that is in the transaction that is being validated. If you use the CDB API, you are reading the data that is currently in CDB, not in the transaction that is about to be committed if validation succeeds.
Yes, the DP API requires a control socket and at least one worker socket. See the ConfD UG chapter “C Example with Operational Data”
If you use the CDB API, you are reading the data that is currently in CDB, not in the transaction that is about to be committed if validation succeeds.
OK. this is an important info. What you are saying is that MAAPI allows me to look at the data before it is committed into the CDB while working with CDB API, I’m getting notifications after the new config was committed into the CDB. Right?
Yes, you get CDB subscriber notifications for the configuration changes after the new config was written to CDB. At that time The MAAPI and CDB API show the same config (that was committed to CDB). In the validation phase, the config has not yet been written to CDB. See ConfD UG chapter “Validating Data in C” and confd_lib_dp(3) man page section “VALIDATION CALLBACKS” for details.