ConfD User Community

Compile YANG module using flag of --feature



I tried to compile the YANG module with the option of --feature but it looks like it doesn’t work.
The result is that all the features supported even features that I didn’t mention in the compile command.

For example:
…/…/cml/confd/kvm/Confd/bin/confdc -c --annotate eci-ldp-ann.yang -o eci-ldp-aug.fxs --verbose --fail-on-warnings -F eci-alarms:alarm-support eci-ldp-aug.yang


…/…/cml/confd/kvm/Confd/bin/confdc -c --annotate eci-ldp-ann.yang -o eci-ldp-aug.fxs --verbose --fail-on-warnings --feature eci-alarms:alarm-support eci-ldp-aug.yang

For both examples all the features mentioned in the eci-ldp-aug.yang module were supported.

I tried to compile with the flag of --no-features and it worked. But I want some features to be supported and some not.

Please assist.




The command you entered looks good. I am suspecting that confdc can’t find where your feature “alarm-support” is defined.

Check the example: $CONFD_DIR/examples.confd/linuxcfg/ietf_system as well, for testing.

If the feature definition is not found, the default is that all the features are enabled just as if you didn’t specify the option ‘-F’.

You can select multiple features that you want to enable. The example mentioned above shows how to do that. make all, then look at the confdc command used.




I checked your example “ietf_system” and looks like it has the same problem.
When I compiled it with the makefile the .h file contained define for “authentication-port” which is under the “radius” container the was defined under the “if-feature radius” that wasn’t mentioned in the compilation command.
After that I compiled the model with the flag “–no-features” and the result now was that “authentication-port” wasn’t defined in the .h file.

It means that -F flag isn’t working as I said.
Please assist.




It seems the Makefile(s) in the linuxcfg example uses the -F option incorrectly in versions prior to ConfD-6.5:

$ make ietf-system.h
/tmp/confd-6.4/bin/confdc  -F ntp -F timezone-name \
 -a ietf-system-ann.yang -c \
        --yangpath ..:/tmp/confd-6.4/src/confd/snmp/yang -o ietf-system.fxs ietf-system.yang
/tmp/confd-6.4/bin/confdc --emit-h ietf-system.h ietf-system.fxs
$ grep authentication.port ietf-system.h
#define sys_authentication_port 508401414

Fixed in 6.5:

$ make ietf-system.h
/tmp/confd-6.5/bin/confdc  -F ietf-system:ntp,timezone-name \
 -a ietf-system-ann.yang -c \
        --yangpath ..:/tmp/confd-6.5/src/confd/snmp/yang -o ietf-system.fxs ietf-system.yang
/tmp/confd-6.5/bin/confdc --emit-h ietf-system.h ietf-system.fxs
$ grep authentication.port ietf-system.h

I.e. as described in the confdc(1) manual page (already in 6.0):

   -F features, --feature features
       Indicates that support for the YANG features should be present in
       the fxs file.  features is a string on the form

Note that the ‘modulename’ is the name of the module where the feature is defined.