yangdump(1)
β¨ NAME β¨
okay so bestie, welcome to yangdump(1) from yangdump 2.2. This icon is here to validate YANG modules and convert them to different formats. πβ¨
π¦ SYNOPSIS π¦
yangdump (module=value | subtree=value)+ [parameter=value...]
yangdump --help [brief | normal | full]
yangdump --version
yangdump --show-errors
π DESCRIPTION π
okay so yangdump provides validation and translation of YANG data models. Information about a module or submodule can be generated as well. This version of yangdump supports the YANG data modeling language defined in RFC 6020. β¨
The format parameter is used to select a translation output mode. If it is missing, then no translation will be done. π
This parameter can be used with the module reports parameters, but the translation output should be directed to a file instead of STDOUT to keep them separated. π«Ά
For XSD 1.0 translation, use the format=xsd parameter.
For XHTML 1.0 translation, use the format=html parameter.
For a 1 line output of the module name and version, use the modversion parameter.
For a listing of all the symbols that the file exports to other files, use the exports parameter.
For a listing of all the files that the file depends on, to compile, use the dependencies parameter.
For a listing of all the accessible object identifiers that the file contains, use the identifiers parameter.
For a listing of all the accessible object identifiers that the file contains, in tree format, use the tree-identifiers parameter. πΈ
πΈ USAGE πΈ
Parameters can be entered in any order, and have the form:
[start] name [separator [value]]
where:
start== 0, 1, or 2 dashes (foo,-foo,--foo)name== parameter name- Parameter name completion will be attempted if a partial name is entered.
separator== whitespace or equals sign (foo=bar,foo bar)value== string value for the parameter.- Strings with whitespace need to be double quoted (
--foo="some string")
- Strings with whitespace need to be double quoted (
Some examples of valid command line parameters:
foo=3
-foo=3
--foo=3
foo 3
foo=fred
--foo "fred flintstone"
Partial parameter names can be entered if they are unique. β¨
π OPTIONS π
--config=filespecβ The name of the configuration file to use. Any parameter except this one can be set in the config file. The default config file/etc/yuma/yangdump.confwill not be checked if this parameter is present.--defnames=booleanβ If true, output to a file with the default name for the format, in the current directory. The default value is'false'.- If the
outputparameter is present and represents an existing directory, then the default filename will be created in that directory, instead of the current directory.
- If the
--dependenciesβ Validate the file, write the module name, version and module source for each file that this[sub]moduleimports and includes, then exit.- Each dependency type, name, version, and source is listed once.
- If the dependency version and source are missing, then that import or include file was not found.
--deviation=stringβ This parameter identifies a YANG module that should only be checked for deviation statements for external modules. These will be collected and applied to the real module(s) being processed.- Deviations are applied as patches to the target module. Since they are not identified in the target module at all (ala imports), they have to be specified explicitly, so they will be correctly processed. Zero or more instances of this parameter are allowed.
--exportsβ Validate the file, write information for the symbols that this[sub]moduleexports, then exit. Report includes the following info for the specific file, not the entire module, if submodules are used:[sub]module nameversionsource filespecnamespace(module only)prefix(module only)belongs-to(submodule only)typedefsgroupingsobjects, rpcs, notificationsextensions.
--feature-code-default=enumβ If'dynamic'(the default), then dynamic SIL feature code will be generated by default. If'static', then static SIL feature code will be generated by default. Iffalse, then features will be disabled by default.--feature-disable=module:featureβ Identifies a feature which should be considered disabled.--feature-dynamic=module:featureβ Identifies a dynamic feature for SIL code generation purposes. Zero or more entries are allowed.--feature-enable-default=booleanβ If true (the default), then features will be enabled by default. If false, then features will be disabled by default.--feature-enable=module:featureβ Identifies a feature which should be considered enabled. Zero or more entries are allowed.--feature-static=module:featureβ Identifies a static feature for SIL code generation purposes. Zero or more entries are allowed.--format=stringβ Type of conversion desired, if any. If this parameter is missing, then no translation will be done, but the module will be validated, and any requested reports will be generated.- The following translation formats are available:
xsd: XSD 1.0
html: XHTML 1.0
yang: Canonical YANG (in progress)
copy: Validate, and copy with a new name
yin: YIN format
c: Combined Yuma and User SIL C module
h: Combined Yuma and User SIL H file
uc: User part of a split SIL C module
uh: User part of a split SIL H file
yc: Yuma part of a split SIL C module
yh: Yuma part of a split SIL H file
--helpβ Print this help text and exit. The help-mode choice (--brief,--normal, or--full) may also be present to control the amount of help text printed.--home=dirspecβ Directory specification for the home directory to use instead ofHOME.--html-divβ If HTML translation is requested, then this parameter will cause the output to be a single<div>element, instead of an entire HTML file. This allows the HTML translation to be easily integrated within more complex WEB pages, but the proper CSS definitions need to be present for the HTML to render properly.- The default filename extension will be
'.div'instead of'.html'if this parameter is present. The contents will be well-formed XHTML 1.0, but without any namespace declarations.
- The default filename extension will be
--html-toc=stringβ The HTML Table of Contents output mode. Ignored unless theformatparameter is set tohtml. Default ismenu.- Values:
none: no ToC generatedplain: plain list ToC generatedmenu: drop-down menu ToC generated.
- Values:
--identifiersβ Validate the file, write the list of object identifiers, that this[sub]modulecontains, then exit.- Each accessible object node is listed once, including all child nodes. Notifications and RPC methods are considered top-level objects, and have object identifiers as well as configuration and state data..
--indent=numberβ Number of spaces to indent (0..9) in formatted output. The default is 2 spaces.--log=filespecβ Filespec for the log file to use instead ofSTDOUT. If this string begins with a'~'character, then a username is expected to follow or a directory separator character. If it begins with a'$'character, then an environment variable name is expected to follow.--log-appendβ If present, the log will be appended not over-written. If not, the log will be over-written. Only meaningful if thelogparameter is also present.--log-level=enumβ Sets the debug logging level for the program.--modpath=listβ Directory search path for YANG and YIN files. Overrides theYUMA_MODPATHenvironment variable.--module=stringβ YANG or YIN source module name to validate and convert.- If this string represents a filespec, ending with the
.yangor.yinextension, then only that file location will be checked. - If this string represents a module name, then the module search path will be checked for a file the
.yangor.yinextension. - If this string begins with a
'~'character, then a username is expected to follow or a directory separator character. If it begins with a'$'character, then an environment variable name is expected to follow.
- If this string represents a filespec, ending with the
~/some/path ==> <my-home-dir>/some/path
~fred/some/path ==> <fred-home-dir>/some/path
$workdir/some/path ==> <workdir-env-var>/some/path
--modversionβ Validate the file, write the[sub]modulename, version and source filespec, then exit.--objview=stringβ Determines how objects are generated in HTML and YANG outputs. The default mode is the raw view. XSD output is always cooked, since refined groupings and locally-scoped definitions are not supported in XSD. Values:raw-- output includes augment and uses clauses, not the expanded results of those clauses.cooked-- output does not include augment or uses clauses, just the objects generated from those clauses.
--output=filespecβ Output file name to use. Default isSTDOUTif none specified and thedefnameparameter is also missing.- If this parameter represents an existing directory, then the
defnamesparameter will be assumed by default, and the translation output file(s) will be generated in the specified directory. - If this parameter represents a file name, then the
defnamesparameter will be ignored, and all translation output will be directed to the specified file. - If this string begins with a
'~'character, then a username is expected to follow or a directory separator character. If it begins with a'$'character, then an environment variable name is expected to follow.
- If this parameter represents an existing directory, then the
~/some/path ==> <my-home-dir>/some/path
~fred/some/path ==> <fred-home-dir>/some/path
$workdir/some/path ==> <workdir-env-var>/some/path
--show-errorsβ bestie, if you pass this, it just dumps every single error and warning number with its default message string, then dips. That's it, that's the whole job. Exit stage left after the list. π--simurls=booleanβ if this istrueAND you asked for HTML translation, then URLs inside links get generated in that simplified format the WEB dev engines like CherryPy love so much. Default isfalse. Two formats, side by side:
Normal URL format:
example.html?parm1=foo&parm2=bar#frag
Simplified URL format:
example/foo/bar#frag
--stats=enumerationβ this one controls the YANG usage statistics report generation. enum values, going down the list:none: (default) β literally no statistics reporting, zero, nada, the report does not happen.brief: β brief statistics reporting, which is:- Complexity score
- Total nodes
basic: β basic statistics reporting will be done.advanced: β advanced statistics reporting will be done.all: β all possible statistics reporting will be done. go big or go home. π₯
--subdirs=booleanβ iffalse, the file search paths for modules, scripts, and data files will not include sub-directories even when they exist in the path you gave. Iftrue, then those search paths will include sub-directories if they're there. Any directory name starting with a dot (.) or namedCVSgets ignored.trueis the default mode, fyi. πΈ--subtree=stringβ path spec of the directory subtree you want converted. Everything YANG and YIN inside that sub-tree gets processed, no cap.
If the format parameter is present, then one file with the default name gets generated for each YANG or YIN file found in the sub-tree.
Heads up though β symbolic links are not followed during the directory traversal. Only real directories get searched, and regular files get checked as modules. If a module has errors, processing just moves on to the next file. Keep it pushing. π
If the string starts with a ~ character, a username is expected to follow, or a directory separator character. If it starts with a $ character, then an environment variable name is expected to follow.
This parameter may be present zero or more times.
~/some/path ==> <my-home-dir>/some/path
~fred/some/path ==> <fred-home-dir>/some/path
$workdir/some/path ==> <workdir-env-var>/some/path
--totals=enumerationβ controls summary YANG usage statistics report generation. Must be used with the--statsparameter, they're a package deal, you can't split them up. π«Ά enum values:none: (default) β no summary statistics reporting will be done.summary: β summary statistics totals will be reported, based on the stats mode that is requested.summary-onlyβ only the summary statistics totals will be reported, based on the stats mode that is requested. This mode will cause all individual module statistics reports to be generated, and a summary for all input modules will be generated instead.
--tree-identifiersβ validate the file, write the hierarchy of node names in tree format that this [sub]module contains, then exit. Each accessible object node is listed once, including all child nodes. Notifications and RPC methods count as top-level objects, and they have object identifiers as well as configuration and state data. π--unified=booleanβ iftrue, submodules get processed inside the main module in one unified report, instead of separately, one report per file.
For translation purposes, this parameter makes any sub-modules get treated as if they were defined in the main module. Actual definitions get generated instead of an include directive, for each submodule.
If false (the default), then a separate output file gets generated for each input file, so XSD output and other reports for a main module won't include info for submodules.
If you set this to true, then submodules entered with the module parameter get ignored. bye bestie π
--urlstart=stringβ if present, this string gets prepended to HREF links and URLs generated for SQL and HTML translation. It's expected to be a URL ending with a directory path. The trailing separator/gets added if it's missing.
If it's not present (the default), then relative URLs starting with the file name get generated instead.
For example, if this parameter is set to
'http://acme.com/public'
then the URL generated for the 'bar' type on line 53, in the module FOO (version 2008-01-01) would be:
if no-versionnames set:
'http://acme.com/public/FOO.html#bar.53'
OR
if no-versionnames not set (default):
'http://acme.com/public/FOO_2008-01-01.html#bar.53'
--versionβ print the yangdump version string and exit. quick little flex. β¨--versionnames=booleanβ iffalse, the default filenames won't contain the module version string. Iftrue, the [sub]module name and version string are both used to generate a default file name, when thedefnamesoutput parameter is used. This flag causes filenames and links to be generated which do not contain the version string. The default value istrue.--warn-idlen=numberβ controls whether identifier length warnings get generated. A value of zero disables all identifier length checking. If it's non-zero, then a warning gets generated if an identifier is defined which has a length greater than this amount. range:0 | 8 .. 1023. The default value is64.--warn-linelen=numberβ controls whether line length warnings get generated. Zero disables all line length checking. If non-zero, a warning gets generated if the line length is greater than this amount. Tab characters are counted as 8 spaces, just so you know. range:0 | 40 .. 4095. The default value is72.--warn-off=numberβ controls whether the specified warning number gets generated and counted in the warning total for the module being parsed. range:400 .. 899. This parameter may be entered zero or more times.--xsd-schemaloc=stringβ if present, this string gets prepended to output XSD filenames when generatingschemaLocationclauses. It's expected to be a URL ending with a directory path. The trailing separator/gets added if it's missing. This parameter is also prepended to URLs generated forincludeandimportdirectives within the XSD.
If it's not present (the default), then the schemaLocation element is not generated during XSD translation. Relative URLs for include and import directives will be generated, starting with the file name.
For example, if this parameter is set to
'http://acme.com/public'
then the schemaLocation XSD for the module FOO (version 01-01-2008) would be:
if no-versionnames set:
'http://acme.com/public/FOO.xsd'
OR
if no-versionnames not set (default):
'http://acme.com/public/FOO_2008-01-01.xsd'
--yuma-home=stringβ the directory for the yuma project root to use. If present, this directory location overrides theYUMA_HOMEenvironment variable if that's set. If you enter a zero-length string, then theYUMA_HOMEenvironment variable gets ignored entirely. π
π INPUT FILES π
Okay so operations can be performed on one or more files with the module parameter, or on an entire directory tree with the subtree parameter. Unless the help, version, or show-errors parameters is entered, one of these input file parameters is mandatory. Each of these parameters may be entered multiple times. The default parameter for yangdump is 'module', so these two commands are equivalent, fr fr:
yangdump --module=foo
yangdump foo
Real talk though β 'foo' must not match another parameter name. If it does, you have to use the module parameter name for that module. Like this:
yangdump --module=help
π SEARCH PATH π
When a module name is entered as input, or when a module or submodule name is specified in an import or include statement inside the file, this is the search algorithm used to find the file:
- file is in the current directory
YUMA_MODPATHenvironment var (or set by modpath parameter)$HOME/modulesdirectory$YUMA_HOME/modulesdirectory$YUMA_INSTALL/modulesdirectory OR default install module location,'/usr/share/yuma/modules'
By default, the entire directory tree for all locations (except step 1) gets searched, not just the specified directory. The subdirs parameter can be used to stop sub-directories from being searched. π¦
Any directory name beginning with a dot character (.) gets skipped. Also, any directory named CVS gets skipped in directory searches. not today, CVS. π
π€ OUTPUT MODES π€
By default, any translation output goes straight to STDOUT. main character behavior.
The output parameter can be used to specify the full filespec of the output file to use instead.
The defname parameter can be used to generate a default filename in the current directory for the output.
E.g., the default XSD filename is <name>_<version>.xsd.
This is the default mode when subtree input mode is selected. π
π¬ ERROR LOGGING π¬
Okay so bestie, listen β by default, warnings and errors get yeeted straight to STDOUT. That's just how it is. πΈ
But if you'd rather they go somewhere cuter, you can point them at a log file with the log parameter. β¨
Now, if that log file already exists and you're lowkey attached to what's in it, use the logappend parameter to keep adding to it. Otherwise? It gets overwritten. Gone. Poof. π So be careful, fr fr.
You also get to choose how chatty things are with the log-level parameter.
The default log level is info, and here's the thing β the log-levels are additive. So each one stacks on top of the ones before it:
off: suppress all errors (not recommended!) β and heads up, a program return code of1indicates some error.error: print errorswarn: print warningsinfo: print generally interesting trace infodebug: print general debugging trace infodebug2: print verbose debugging trace infodebug3: print very verbose debugging trace infodebug4: print maximum debugging trace info
π ENVIRONMENT π
These optional environment variables are here to control how module search behaves, and honestly they're giving config queen π
HOMEβ The user's home directory (e.g.,/home/andy)YUMA_HOMEβ The root of the user's Yuma work directory (e.g.,/home/andy/swdev/netconf)YUMA_INSTALLβ The root of the directory thatyangdumpis installed on this system (default is,/usr/share/yuma)YUMA_MODPATHβ Colon-separated list of directories to search for modules and submodules.
(e.g.: './workdir/modules:/home/andy/test-modules')
Heads up bestie: the modpath parameter will override this environment variable, if both are present. π
π CONFIGURATION FILES π
yangdump.conf
YANG config file. The default is: /etc/yuma/yangdump.conf
An ASCII configuration file format is supported to store command line parameters. Iconic, honestly. β¨
The config parameter is used to specify a specific config file, otherwise the default config file will be checked.
So here's the rules, and you gotta know them:
- A hash mark until EOLN is treated as a comment
- All text is case-sensitive
- Whitespace within a line is not significant
- Whitespace to end a line is significant/ Unless the line starts a multi-line string, an escaped EOLN (backslash EOLN) is needed to enter a leaf on multiple lines.
- For parameters that define lists, the key components are listed just after the parameter name, without any name, e.g.,
interface eth0 {
# name = eth0 is not listed inside the braces
ifMtu 1500
ifName mySystem
}
A config file can contain any number of parameter sets for different programs. Multitasking icon behavior. π
Each program must have its own section, identifies by its name:
# this is a comment
yangdump {
log-level debug
output "~/swdev/testfiles"
}
netconfd {
...
}
π FILES π
The following data files must be present in the module search path in order for this program to function:
- YANG module library β default:
/usr/share/yuma/modules/
Like, no files, no vibes. π¦
π©Ί DIAGNOSTICS π©Ί
Internal diagnostics may generate the following type of message if any bugs are detected at runtime:
[E0]
filename.c:linenum error-number (error-msg)
If you see this, it's a bug, not a you problem. Screenshot it and tell somebody. π
π AUTHOR π
Andy Bierman, <andy at netconfcentral dot org>
π SEE ALSO π
netconfd(1) yangcli(1) yangdiff(1)
And that's the whole page bestie, we ate and left no crumbs π This one's from the Linux corner of the world, dated February 6, 2012, and yeah β it's yangdump(1). Go forth and dump some YANG, you main character. πβπ«Ά
π¦ where this page comes from
- debian bookworm: yangdump 2.13-1
- debian trixie: yangdump 2.14-1
- ubuntu jammy: yangdump 2.12-1build1
- ubuntu noble: yangdump 2.13-2.1build2
- ubuntu questing: yangdump 2.14-1build1
- ubuntu resolute: yangdump 2.14-1build2
- ubuntu stonking: yangdump 2.14-1build3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms