How to convert a hash to confd_value_t

The standard microwave-radio-link@2016-05-10.yang defines identity carrier-termination.

	identity carrier-termination {
		base ianaift:iana-interface-type;
		description
		 "Interface identity for a carrier termination.";
	}

The confdc generated microwave-radio-link@2016-05-10.h
is like this:

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

#ifndef mrl__ns
#define mrl__ns 1882199851
#define mrl__ns_id "urn:ietf:params:xml:ns:yang:microwave-radio-link"
#define mrl__ns_uri "urn:ietf:params:xml:ns:yang:microwave-radio-link"
#endif

#define mrl_carrier_termination 392043072

Can we convert the hash value (only mrl_carrier_termination 392043072 but without mrl__ns 1882199851) to a confd_value_t?

I know that with both mrl_carrier_termination and mrl__ns we can convert them to [struct confd_identityref idref] and then CONFD_SET_IDENTITYREF.

What I need is to use only mrl_carrier_termination to convert to a confd_value_t.

Hello,

The identity to be referenced by “identityref” is defined according to RFC by an id and a namespace.
https://tools.ietf.org/html/rfc6020#section-9.10

Thus, the confd-lib procedures/macros working with the type require/return both “ns” and “id” (CONFD_SET_IDENTITYREF() / CONFD_GET_IDENTITYREF() ).

if the identity that you need to reference is “local” to the currently processed module, namespace should be available as well to use in the macros/C struct - know by the processing code…

What is the use case for the confd_value_t of the identity that you describe (without the namespace)?

Do you want to work with a target identityref value, or with some keypath pointing to the identityref?
(in which case, namespace + C_XMLTAG of “mrl_carrier_termination” should be usable)

best regards,
j.m.

From ConfD User guide:

struct confd_identityref {
    u_int32_t ns;
    u_int32_t id;
};

So I assume it is not possible.

Just for curiosity, if you have generated header file from the yang file, then there should not be a problem to access namespace ..._ns hash tag.