# ovsdb-idlc

## NAME



           ovsdb-idlc - Open vSwitch IDL (Interface Definition Language)
           compiler
    


## SYNOPSIS



           **ovsdb-idlc annotate** _schema annotations_
           **ovsdb-idlc c-idl-header** _idl_
           **ovsdb-idlc c-idl-source** _idl_
           **ovsdb-idlc --help**
           **ovsdb-idlc --version**
    


## DESCRIPTION



           The **ovsdb-idlc** program is a command-line tool for translating Open
           vSwitch database interface definition language (IDL) schemas into
           other formats.  It is used while building Open vSwitch, not at
           installation or configuration time.  Thus, it is not normally
           installed as part of Open vSwitch.
    
           The _idl_ files used as input for most **ovsdb-idlc** commands have the
           same format as the OVSDB schemas, specified in the OVSDB
           specification, with a few additions:
    
           "**idlPrefix** " member of <database-schema>
                  This member, which is required, specifies a string that is
                  prefixed to top-level names in C bindings.  It should
                  probably end in an underscore.
    
           "**idlHeader** " member of <database-schema>
                  This member, which is required, specifies the name of the
                  IDL header.  It will be output on an **#include** line in the
                  source file generated by the C bindings.  It should include
                  the bracketing **""** or **< >**.
    
           "**cDecls** " member of <database-schema>
           "**hDecls** " member of <database-schema>
                  These optional members may specify arbitrary code to
                  include in the generated **.c** or **.h** file, respectively, in
                  each case just after the **#include** directives in those
                  files.
    
           "**extensions** " member of <table-schema>
           "**extensions** " member of <column-schema>
                  This member is optional.  If specified, it is an object
                  whose contents describes extensions to the OVSDB schema
                  language, for the purpose of specifying interpretation by
                  the IDL.
    
           "**synthetic** " member of <column-schema> "**extensions** " object
                  If this optional member is set to **true** , then it indicates
                  that the column is not expected to be found in the actual
                  database.  Instead, code supplied by the IDL's client fills
                  in the desired structure members based on the value of one
                  or more other database columns.  This can be used to cache
                  the result of a calculation, for example.
    
           "**parse** " member of <column-schema> "**extensions** " object
                  This member should be present if and only if the column is
                  synthetic.  It should be a string that contains C code to
                  set the value of the column's member in an object named
                  **row** , e.g. "**row- >column = 1;**" if the column's name is **column**
                  and has integer type.  The code may rely on the columns
                  named in **dependencies** to be initialized.  The function can
                  get called for rows that do not satisfy the constraints in
                  the schema, e.g. that a pointer to another is nonnull, so
                  it must not rely on those constraints.
    
           "**unparse** " member of <column-schema> "**extensions** " object
                  This member is honored only if the column is synthetic.  It
                  should be a string that contains C code to free the data in
                  the column's member in an object named **row** , e.g.
                  "**free(row- >column);**" if the column's name is **column** and
                  points to data that was allocated by the **parse** function and
                  needs to be freed.
    
           "**dependencies** " member of <column-schema> "**extensions** " object
                  This member should be a list of the names of columns whose
                  values are used by the code in **parse** and **unparse**.  The IDL
                  ensures that dependencies are parsed before the columns
                  that depends on them, and vice versa for unparsing.
    
       **Commands**
           **annotate** _schema annotations_
                  Reads _schema_ , which should be a file in JSON format
                  (ordinarily an OVSDB schema file), then reads and executes
                  the Python syntax fragment in _annotations_.  The Python
                  syntax fragment is passed the JSON object as a local
                  variable named **s**.  It may modify this data in any way.
                  After the Python code returns, the object as modified is
                  re-serialized as JSON on standard output.
    
           **c-idl-header** _idl_
                  Reads _idl_ and prints on standard output a C header file
                  that defines a structure for each table defined by the
                  schema.  If a column name in _idl_ is a C or C++ keyword, it
                  will be appended with an underscore.
    
           **c-idl-source** _idl_
                  Reads _idl_ and prints on standard output a C source file
                  that implements C bindings for the database defined by the
                  schema.  If a column name in _idl_ is a C or C++ keyword, it
                  will be appended with an underscore.
    
       **Options**
    


## BUGS



           **ovsdb-idlc** is more lenient about the format of OVSDB schemas than
           other OVSDB tools.  It may successfully parse schemas that, e.g.,
           **ovsdb-tool** rejects.
    


* * *