]> git.proxmox.com Git - mirror_ovs.git/blame - ovsdb/ovsdb-idlc.1
ovn-nbctl: Fix the ovn-nbctl test "LBs - daemon" which fails during rpm build
[mirror_ovs.git] / ovsdb / ovsdb-idlc.1
CommitLineData
d879a707 1.\" -*- nroff -*-
00386a69
BP
2.de IQ
3. br
4. ns
5. IP "\\$1"
6..
d879a707
BP
7.TH ovsdb\-idlc 1 "November 2009" "Open vSwitch" "Open vSwitch Manual"
8.ds PN ovsdb\-idlc
9.
10.SH NAME
11ovsdb\-idlc \- Open vSwitch IDL (Interface Definition Language) compiler
12.
13.SH SYNOPSIS
c5c7c7c5 14\fBovsdb\-idlc \fBannotate\fI schema annotations\fR
d879a707 15.br
00732bf5 16\fBovsdb\-idlc \fBc\-idl\-header\fI idl\fR
d879a707 17.br
00732bf5 18\fBovsdb\-idlc \fBc\-idl\-source\fI idl\fR
d879a707 19.br
4e312e69 20\fBovsdb\-idlc \-\-help\fR
d879a707 21.br
4e312e69 22\fBovsdb\-idlc \-\-version\fR
d879a707
BP
23.
24.SH DESCRIPTION
25The \fBovsdb\-idlc\fR program is a command-line tool for translating
26Open vSwitch database interface definition language (IDL) schemas into
27other formats. It is used while building Open vSwitch, not at
28installation or configuration time. Thus, it is not normally
29installed as part of Open vSwitch.
30.
31.PP
00732bf5
BP
32The \fIidl\fR files used as input for most \fBovsdb\-idlc\fR commands
33have the same format as the OVSDB schemas, specified in the OVSDB
34specification, with a few additions:
d879a707 35.
4c0ca6b7 36.IP """\fBidlPrefix\fR"" member of <database-schema>"
c3bb4bd7
BP
37This member, which is required, specifies a string that is prefixed to
38top-level names in C bindings. It should probably end in an
39underscore.
40.
4c0ca6b7 41.IP """\fBidlHeader\fR"" member of <database-schema>"
c3bb4bd7
BP
42This member, which is required, specifies the name of the IDL header.
43It will be output on an \fB#include\fR line in the source file
44generated by the C bindings. It should include the bracketing
45\fB""\fR or \fB<>\fR.
46.
4c0ca6b7
JS
47.IP """\fBcDecls\fR"" member of <database-schema>"
48.IQ """\fBhDecls\fR"" member of <database-schema>"
0ea866bb
BP
49These optional members may specify arbitrary code to include in the
50generated \fB.c\fR or \fB.h\fR file, respectively, in each case just
51after the \fB#include\fR directives in those files.
52.
4c0ca6b7
JS
53.IP """\fBextensions\fR"" member of <table-schema>"
54.IQ """\fBextensions\fR"" member of <column-schema>"
00386a69
BP
55This member is optional. If specified, it is an object whose contents
56describes extensions to the OVSDB schema language, for the purpose of
57specifying interpretation by the IDL.
00386a69 58.
4c0ca6b7 59.IP """\fBsynthetic\fR"" member of <column-schema> ""\fBextensions\fR"" object"
01928c96
BP
60If this optional member is set to \fBtrue\fR, then it indicates that
61the column is not expected to be found in the actual database.
62Instead, code supplied by the IDL's client fills in the desired
63structure members based on the value of one or more other database
64columns. This can be used to cache the result of a calculation, for
65example.
66.
4c0ca6b7 67.IP """\fBparse\fR"" member of <column-schema> ""\fBextensions\fR"" object"
01928c96
BP
68This member should be present if and only if the column is synthetic.
69It should be a string that contains C code to set the value of the
70column's member in an object named \fBrow\fR, e.g. "\fBrow->column =
4c0ca6b7 711;\fR" if the column's name is \fBcolumn\fR and has integer type. The
01928c96
BP
72code may rely on the columns named in \fBdependencies\fR to be
73initialized. The function can get called for rows that do not satisfy
74the constraints in the schema, e.g. that a pointer to another is
75nonnull, so it must not rely on those constraints.
76.
4c0ca6b7 77.IP """\fBunparse\fR"" member of <column-schema> ""\fBextensions\fR"" object"
01928c96
BP
78This member is honored only if the column is synthetic. It should be
79a string that contains C code to free the data in the column's member
4c0ca6b7 80in an object named \fBrow\fR, e.g. "\fBfree(row->column);\fR" if the
01928c96
BP
81column's name is \fBcolumn\fR and points to data that was allocated by
82the \fBparse\fR function and needs to be freed.
83.
4c0ca6b7 84.IP """\fBdependencies\fR"" member of <column-schema> ""\fBextensions\fR"" object"
01928c96
BP
85This member should be a list of the names of columns whose values are
86used by the code in \fBparse\fR and \fBunparse\fR. The IDL ensures
87that dependencies are parsed before the columns that depends on them,
88and vice versa for unparsing.
d879a707 89.SS "Commands"
00732bf5
BP
90.IP "\fBannotate\fI schema annotations\fR"
91Reads \fIschema\fR, which should be a file in JSON format (ordinarily
92an OVSDB schema file), then reads and executes the Python syntax
93fragment in \fIannotations\fR. The Python syntax fragment is passed
94the JSON object as a local variable named \fBs\fR. It may modify this
95data in any way. After the Python code returns, the object as
96modified is re-serialized as JSON on standard output.
97.
98.IP "\fBc\-idl\-header\fI idl\fR"
99Reads \fIidl\fR and prints on standard output a C header file that
adb4185d
YHW
100defines a structure for each table defined by the schema. If a column
101name in \fIidl\fR is a C or C++ keyword, it will be appended with an
102underscore.
d879a707 103.
00732bf5
BP
104.IP "\fBc\-idl\-source\fI idl\fR"
105Reads \fIidl\fR and prints on standard output a C source file that
adb4185d
YHW
106implements C bindings for the database defined by the schema. If a column
107name in \fIidl\fR is a C or C++ keyword, it will be appended with an
108underscore.
d879a707
BP
109.
110.SS "Options"
111.so lib/common.man
112.
113.SH "BUGS"
114\fBovsdb\-idlc\fR is more lenient about the format of OVSDB schemas
00732bf5
BP
115than other OVSDB tools. It may successfully parse schemas that, e.g.,
116\fBovsdb\-tool\fR rejects.
d879a707
BP
117.
118.SH "SEE ALSO"
119The OVSDB specification.