How to define list of features during confdc compilation

Hello,

I would like to use the “-F Feature” as part of confdc to support only the following features in ietf-isis@2017-07-25.yang:
auto-cost
graceful-restart
admin-control

What should be the syntax , in order to have only these features and not others (e.g. nsr)?

thanks,
Orly

Either: confdc -F auto-cost -F graceful-restart -F admin-control ... or confdc -F auto-cost,graceful-restart,admin-control ....

From the confdc(1) man-page:

-Ffeatures, --feature features
Indicates that support for the YANG features should be present in the fxs file. features is a string on the form modulename:[feature(,feature)*]

This option is used to prune the data model by removing all nodes that are defined with a “if-feature” that is not listed as feature.

This option can be given multiple times.

If this option is not given, nothing is pruned, i.e., it works as if all features were explicitly listed.

If the module uses a feature defined in an imported YANG module, it must be given as modulename:feature.

Hi jjohansson,

Thanks for the quick response.

After using the command:
“confdc -F auto-cost -F graceful-restart -F admin-control”

I used the emit command to generate .h file and still see the definitions for nsr.
When I used the option:
“confdc --no-features” and performed the emit command to generate .h file I don’t see the nsr definitions.

Please clarify.
thanks,
Orly

I’m afraid the confdc(1) man page is rather confusing here - you should focus on the statement

features is a string on the form modulename:[feature(,feature)*]

and ignore the statement

If the module uses a feature defined in an imported YANG module, it must be given as modulename:feature.

The second statement is correct, but redundant (and thus confusing), since per the first statement, modulename: must always be included.

I.e. assuming that the features are defined in the module called “isis”, the correct form is

-F isis:auto-cost,graceful-restart,admin-control

Hi Per,

Thanks for the clarification.
It makes sense to use this syntax for all cases: ( -F :feature[,feature2])
Such approach is used also in pyang compiler

Hi,

Can I add all the supported features in annotate YANG module instead of mention it in the confdc command?
Is there such definition in Confd?

thanks,

No, this is not possible - annotations just add statements that could alternatively be written directly in the module, and there is no ‘enable-feature’ statement.