Which part of yang module included in the compiled fxs?

fxs is compiled by using confdc. There are lots of options on the compile tool, i.e. deviation, feature, conformance…
How can I know which parts of the yang module is included in the compiled fxs? Do I need to compile the deviation yang module and load into confd also? What about other cases, for example: features, augment, typedef and uses? Is there any document for this?

Hello Fei,

How can I know which parts of the yang module is included in the compiled fxs?

By default (without any options), there should not be anything excluded, disabled or changed for a compiled Yang module.

Do I need to compile the deviation yang module and load into confd also?

Deviation modules can be provided as an option to the compiler.
eg. $ confdc -c --deviation test-dev.yang test.yang

What about other cases, for example: features, augment, typedef and uses? Is there any document for this?

You can read more on ConfD Manual, try:
$ man confdc

Regards,
Erdem

1 Like

Hi Erdem,

Maybe I didn’t describe my question clearly.
I know the confdc man page. What I want to know is the data structure included in the complied fxs. As I know, the fxs excludes the un-spported features.
Are deviation definiation yang module and grouping definition yang module need to be compiled and loaded to confd with the implemented yang module? Is there a document for this?

Your main guide here should be YANG RFC7950
Features control what is included in the resulting schema (fxs file). augment statements are not present in the schema, the content of what is augmented is added to the schema where the augment string point to. typdefs not added to the schema as they are expanded to its base type and the additional statments in the typedef derived type. “uses” and corresponding “grouping” statements are not added to the schema as the grouping is expanded and inserted where the uses sttatement is located.

A deviation module is both used with the module it deviates and compiled. Example:

$ confdc --deviation my-deviation-module.yang -o test-module.fxs -c test-module.yang
$ confdc -o my-deviation-module.fxs -c my-deviation-module.yang

Again, YANG RFC 7950 is your guide here. See RFC 7950 - The YANG 1.1 Data Modeling Language

Thanks for your support.
Since the ‘grouping’ statements are not added to the schema. I’ve a question about this:
If yang module A.yang only contains grouping definitions, yang module B.yang includes the grouping defined in A.yang by ‘uses’ statement. Is it enough to only compile B.yang module? B.fxs includes all the grouping structure defined in A.yang, right? Is A.yang module still needed by ConfD?

If you include module B as a sub module that belongs to module A, no need to compile B.
If you import module B from module A, you need to compile B.

Thanks.
It’s clear now.