]>
Commit | Line | Data |
---|---|---|
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 | |
11 | ovsdb\-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 | |
25 | The \fBovsdb\-idlc\fR program is a command-line tool for translating | |
26 | Open vSwitch database interface definition language (IDL) schemas into | |
27 | other formats. It is used while building Open vSwitch, not at | |
28 | installation or configuration time. Thus, it is not normally | |
29 | installed as part of Open vSwitch. | |
30 | . | |
31 | .PP | |
00732bf5 BP |
32 | The \fIidl\fR files used as input for most \fBovsdb\-idlc\fR commands |
33 | have the same format as the OVSDB schemas, specified in the OVSDB | |
34 | specification, with a few additions: | |
d879a707 | 35 | . |
4c0ca6b7 | 36 | .IP """\fBidlPrefix\fR"" member of <database-schema>" |
c3bb4bd7 BP |
37 | This member, which is required, specifies a string that is prefixed to |
38 | top-level names in C bindings. It should probably end in an | |
39 | underscore. | |
40 | . | |
4c0ca6b7 | 41 | .IP """\fBidlHeader\fR"" member of <database-schema>" |
c3bb4bd7 BP |
42 | This member, which is required, specifies the name of the IDL header. |
43 | It will be output on an \fB#include\fR line in the source file | |
44 | generated 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 |
49 | These optional members may specify arbitrary code to include in the |
50 | generated \fB.c\fR or \fB.h\fR file, respectively, in each case just | |
51 | after 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 |
55 | This member is optional. If specified, it is an object whose contents |
56 | describes extensions to the OVSDB schema language, for the purpose of | |
57 | specifying interpretation by the IDL. | |
00386a69 | 58 | . |
4c0ca6b7 | 59 | .IP """\fBsynthetic\fR"" member of <column-schema> ""\fBextensions\fR"" object" |
01928c96 BP |
60 | If this optional member is set to \fBtrue\fR, then it indicates that |
61 | the column is not expected to be found in the actual database. | |
62 | Instead, code supplied by the IDL's client fills in the desired | |
63 | structure members based on the value of one or more other database | |
64 | columns. This can be used to cache the result of a calculation, for | |
65 | example. | |
66 | . | |
4c0ca6b7 | 67 | .IP """\fBparse\fR"" member of <column-schema> ""\fBextensions\fR"" object" |
01928c96 BP |
68 | This member should be present if and only if the column is synthetic. |
69 | It should be a string that contains C code to set the value of the | |
70 | column's member in an object named \fBrow\fR, e.g. "\fBrow->column = | |
4c0ca6b7 | 71 | 1;\fR" if the column's name is \fBcolumn\fR and has integer type. The |
01928c96 BP |
72 | code may rely on the columns named in \fBdependencies\fR to be |
73 | initialized. The function can get called for rows that do not satisfy | |
74 | the constraints in the schema, e.g. that a pointer to another is | |
75 | nonnull, so it must not rely on those constraints. | |
76 | . | |
4c0ca6b7 | 77 | .IP """\fBunparse\fR"" member of <column-schema> ""\fBextensions\fR"" object" |
01928c96 BP |
78 | This member is honored only if the column is synthetic. It should be |
79 | a string that contains C code to free the data in the column's member | |
4c0ca6b7 | 80 | in an object named \fBrow\fR, e.g. "\fBfree(row->column);\fR" if the |
01928c96 BP |
81 | column's name is \fBcolumn\fR and points to data that was allocated by |
82 | the \fBparse\fR function and needs to be freed. | |
83 | . | |
4c0ca6b7 | 84 | .IP """\fBdependencies\fR"" member of <column-schema> ""\fBextensions\fR"" object" |
01928c96 BP |
85 | This member should be a list of the names of columns whose values are |
86 | used by the code in \fBparse\fR and \fBunparse\fR. The IDL ensures | |
87 | that dependencies are parsed before the columns that depends on them, | |
88 | and vice versa for unparsing. | |
d879a707 | 89 | .SS "Commands" |
00732bf5 BP |
90 | .IP "\fBannotate\fI schema annotations\fR" |
91 | Reads \fIschema\fR, which should be a file in JSON format (ordinarily | |
92 | an OVSDB schema file), then reads and executes the Python syntax | |
93 | fragment in \fIannotations\fR. The Python syntax fragment is passed | |
94 | the JSON object as a local variable named \fBs\fR. It may modify this | |
95 | data in any way. After the Python code returns, the object as | |
96 | modified is re-serialized as JSON on standard output. | |
97 | . | |
98 | .IP "\fBc\-idl\-header\fI idl\fR" | |
99 | Reads \fIidl\fR and prints on standard output a C header file that | |
adb4185d YHW |
100 | defines a structure for each table defined by the schema. If a column |
101 | name in \fIidl\fR is a C or C++ keyword, it will be appended with an | |
102 | underscore. | |
d879a707 | 103 | . |
00732bf5 BP |
104 | .IP "\fBc\-idl\-source\fI idl\fR" |
105 | Reads \fIidl\fR and prints on standard output a C source file that | |
adb4185d YHW |
106 | implements C bindings for the database defined by the schema. If a column |
107 | name in \fIidl\fR is a C or C++ keyword, it will be appended with an | |
108 | underscore. | |
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 |
115 | than other OVSDB tools. It may successfully parse schemas that, e.g., |
116 | \fBovsdb\-tool\fR rejects. | |
d879a707 BP |
117 | . |
118 | .SH "SEE ALSO" | |
119 | The OVSDB specification. |