/cddlc

CDDL conversion utilities

Primary LanguageRuby

CDDL conversion utilities

This little set of tools provides a number of command line utilities for converting to and from cddl.

0.0.2

Installation

gem install cddlc

Formats

cddlc knows the following formats:

  • .cddl: CDDL as defined in RFC8610
  • .cddlj: JSON form of CDDL (the YIN to the YANG)
  • .cddly: The same JSON form, but serialized in YAML.

These targets are identified by -t cddl, -t json (with -t neat invoking a different prettyprinter), -t yaml. These can be abbreviated (but don't do that in scripts).

With -t enum, cddlc generates C-style enumeration type declarations from integer keys used in a map.

Apart from creating enum declarations, the current version only can transform from input CDDL to one of the JSON/YAML formats of CDDL.

Command line utilities

  • cddlc foo.cddl > foo.cddlj
  • cddlc -tyaml foo.cddl > foo.cddly
  • cddlc -ty foo.cddl > foo.cddly

Output is to stdout, input from one or more files given as command line arguments (use - for standard input).