Using identityref key values in confd_register_range_data_cb()

We want to have different applications registering to provide data in a list where the first part of the key is an identity type. Each application wants to handle the lower and upper bound on that part of the key using confd_register_range_data_cb().

Question is, for a set of identity values, what are the lower and upper values? Do I use the values from the header file? For example if the (sorted) values are:

#define oc_pol_types_BGP 346655972
#define oc_pol_types_ISIS 574246373
#define oc_pol_types_DIRECTLY_CONNECTED 615714624
#define oc_pol_types_OSPF 619009612
#define oc_pol_types_OSPF3 630371620
#define oc_pol_types_STATIC 977019608

Then should the lower range value be oc_pol_types_BGP and the upper range value is oc_pol_types_STATIC?

Thanks,
Barry

From some experimentation it does not appear that identityref values are treated as lexically ordered for the range, but are ordered according to the generated numeric values.

I also wondered if I can use the “base” identity as a wildcard value but that is not accepted in the registration.

Thanks,
Barry

Can you split your identity definitions into multiple namespaces / yang modules? Identities are ordered by their namespace first, then by their hash value, so if you can, ideally, associate each application with one namespace, you still need to take hash values into account when registering range data callbacks, but at least identities are grouped according to your needs.

Worst case, if nothing else works, you can create a central application that registers all callbacks and, given the identityref value, talks to the right application. The communication can be either “direct” through an IPC mechanism; or indirect - create an back-end data model that is not exported to the user, the “real” application register as data providers to that data model and the central application transforms keypaths from the front-end data model to the back-end ones.

Hi Martin, thanks so much to confirm ordering is via hash values. I will take into account the different namespaces but unfortunately I cannot put each application into a different namespace.

I also will try the tailf:id-value extension to see if that allows me to control the ordering.

We will serve up results via a central application if the other options don’t work out.
Thanks,
Barry