Server SIL and SIL-SA Code Generation
The yangdump-pro program can be used to generate C code-stub files for the netconfd-pro server.
Note
The yangdump-sdk program is identical to yangdump-pro, starting in the 21.10-4 release.
Normally a SIL file is generated for a single YANG module. However this does not allow SIL code for external augmentation statements to be generated. In order to generate SIL code for a set of modules, such as a base module and 1 or more modules that augment the main module, the --sil-bundle parameter must be used.
The SIL bundle name must be different than all the module names in the bundle. A H and C file will be generated for the SIL bundle initialization and cleanup hooks (with make_sil_bundle). If the bundle name is 'bundle1', then there will be files created called y_bundle1.c and y_bundle1.h.
The following scripts are installed to help create complete SIL directories. The yangdump-sdk program is invoked multiple times to generate each type of of file each time (e.g, C and H).
make_sil_bundle
make_sil_dir_pro
make_sil_sa_bundle
make_sil_sa_dir
There are 2 modes of operation:
split-mode: The SIL code is split into user and system files. This is the recommended and default approach.
combined-mode: SIL modules contain the user and system callback functions combined. This mode is not recommended since the list keys are not automatically handled in this mode.
Note
The combined mode is now deprecated. The split mode is now the default, starting in 21.10-1.
To inject C “include statements” into the C files that are generated, use the --sil-include parameter.
Note
Code generation defaults have changed starting in the 23.10T-9 release.
--sil-edit3 is the default so it can be omitted
--sil-get2 is the default so it can be omitted
To generate GET1 functions, use the --sil-get1 parameter
To generate EDIT1 functions, use the --sil-edit1 parameter
To generate EDIT2 functions, use the --sil-edit2 parameter
Server Instrumentation H File Generation
There are 4 different parameters for generating SIL developer H files:
--format=h |
Generate combined User and YumaPro SIL H file |
--format=uh |
Generate split User SIL H file |
--format=yh |
Generate split YumaPro SIL H file |
--format=bh |
Generate a SIL bundle H file |
These parameter values are only relevant for YumaPro server developers. Refer to the YumaPro Developer Manual for more details.
Server Instrumentation C File Generation
There are 4 different parameters for generating SIL developer C files:
--format=c |
Generate combined User and YumaPro SIL C file |
--format=uc |
Generate split User SIL C file |
--format=yc |
Generate split YumaPro SIL C file |
--format=bc |
Generate a SIL bundle C file |
These parameter values are only relevant for YumaPro server developers. Refer to the YumaPro Developer Manual for more details.
There are 6 additional parameters for modifying how SIL developer code will be generated:
Parameter |
Description |
---|---|
Generate code for multiple modules instead of 1 module |
|
Generate 2nd generation edit callbacks instead of 1st generation |
|
Generate 3rd generation edit callbacks instead of other generations |
|
Generate 2nd generation get callbacks instead of 1st generation |
|
Generate an 'include' directive for the specified header |
|
Generate additional NMDA code in GET2 functions |
|
Generate SIL-SA code instead of SIL code |
Doxygen Header Generation
The Doxygen program is a widely available open-source program for generating source code documentation.
The auto-generated SIL or SIL-SA code now includes doxygen formatted header comments by default. To turn this feature off, use the --doxygen-headers=false setting, and the original style comments will be generated instead.
Refer to the YumaPro Doxygen Browser section of the YumaPro Developer Manual for more details.