Skip to content

Commit

Permalink
ovsdb: Add ovsdb IDL compiler to build system.
Browse files Browse the repository at this point in the history
This first stab at any interface definition language and compiler for OVSDB
will give other developers a chance to look at it and try to integrate it.
The IDL is not actually implemented yet; I am working on that.
  • Loading branch information
blp committed Nov 24, 2009
1 parent 6bf4c63 commit d879a70
Show file tree
Hide file tree
Showing 32 changed files with 4,812 additions and 165 deletions.
24 changes: 24 additions & 0 deletions COPYING
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,27 @@ Public License, version 2.
Files under the xenserver directory are licensed on a file-by-file
basis. Some files are under an uncertain license that may not be
DFSG-compliant or GPL-compatible. Refer to each file for details.

The files under ovsdb/simplejson are covered by the following license:

Copyright (c) 2006 Bob Ippolito

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
2 changes: 2 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ else
AM_LDFLAGS = -export-dynamic
endif

BUILT_SOURCES =
CLEANFILES =
DISTCLEANFILES =
EXTRA_DIST = INSTALL.bridge \
Expand Down Expand Up @@ -62,6 +63,7 @@ SUFFIXES = .in
-e 's,[@]localstatedir[@],$(localstatedir),g' \
-e 's,[@]pkgdatadir[@],$(pkgdatadir),g' \
-e 's,[@]sysconfdir[@],$(sysconfdir),g' \
-e 's,[@]abs_top_srcdir[@],$(abs_top_srcdir),g' \
> [email protected]
@if head -n 1 [email protected] | grep -q '#!'; then \
echo chmod +x [email protected]; \
Expand Down
1 change: 1 addition & 0 deletions lib/vlog-modules.def
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ VLOG_MODULE(ofproto)
VLOG_MODULE(openflowd)
VLOG_MODULE(ovsdb_client)
VLOG_MODULE(ovsdb_file)
VLOG_MODULE(ovsdb_idl)
VLOG_MODULE(ovsdb_log)
VLOG_MODULE(ovsdb_jsonrpc_server)
VLOG_MODULE(ovsdb_server)
Expand Down
30 changes: 30 additions & 0 deletions ovsdb/automake.mk
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,33 @@ ovsdb_ovsdb_server_LDADD = ovsdb/libovsdb.a lib/libopenvswitch.a $(FAULT_LIBS)
man_MANS += ovsdb/ovsdb-server.1
DISTCLEANFILES += ovsdb/ovsdb-server.1
EXTRA_DIST += ovsdb/ovsdb-server.1.in

# ovsdb-idlc
EXTRA_DIST += \
ovsdb/simplejson/__init__.py \
ovsdb/simplejson/_speedups.c \
ovsdb/simplejson/decoder.py \
ovsdb/simplejson/encoder.py \
ovsdb/simplejson/scanner.py \
ovsdb/simplejson/tests/__init__.py \
ovsdb/simplejson/tests/test_check_circular.py \
ovsdb/simplejson/tests/test_decode.py \
ovsdb/simplejson/tests/test_default.py \
ovsdb/simplejson/tests/test_dump.py \
ovsdb/simplejson/tests/test_encode_basestring_ascii.py \
ovsdb/simplejson/tests/test_fail.py \
ovsdb/simplejson/tests/test_float.py \
ovsdb/simplejson/tests/test_indent.py \
ovsdb/simplejson/tests/test_pass1.py \
ovsdb/simplejson/tests/test_pass2.py \
ovsdb/simplejson/tests/test_pass3.py \
ovsdb/simplejson/tests/test_recursion.py \
ovsdb/simplejson/tests/test_scanstring.py \
ovsdb/simplejson/tests/test_separators.py \
ovsdb/simplejson/tests/test_unicode.py \
ovsdb/simplejson/tool.py
noinst_SCRIPTS += ovsdb/ovsdb-idlc
EXTRA_DIST += \
ovsdb/ovsdb-idlc.in \
ovsdb/ovsdb-idlc.1
DISTCLEANFILES += ovsdb/ovsdb-idlc
74 changes: 74 additions & 0 deletions ovsdb/ovsdb-idlc.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
.\" -*- nroff -*-
.TH ovsdb\-idlc 1 "November 2009" "Open vSwitch" "Open vSwitch Manual"
.ds PN ovsdb\-idlc
.
.SH NAME
ovsdb\-idlc \- Open vSwitch IDL (Interface Definition Language) compiler
.
.SH SYNOPSIS
\fBovsdb\-idlc \fBvalidate\fI schema\fR
.br
\fBovsdb\-idlc \fBovsdb\-schema\fI schema\fR
.br
\fBovsdb\-idlc \fBc\-idl\-header\fI schema\fR
.br
\fBovsdb\-idlc \fBc\-idl\-source\fI schema\fR
.br
\fBovsdb\-idlc --help\fR
.br
\fBovsdb\-idlc --version\fR
.
.SH DESCRIPTION
The \fBovsdb\-idlc\fR 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.
.
.PP
The \fIschema\fR files used as \fBovsdb\-idlc\fR input have the same
format as the OVSDB schemas, specified in the OVSDB specification,
with a few additions:
.
.IP "\fB//\fR comments"
Lines that begin with \fB//\fR (two forward slashes) are ignored and
thus can be used for comments.
.
.IP "\fB""\fBkeyRefTable\fR"" member of <type>"
A <type> whose \fBkey\fR is \fB"uuid"\fR may have an additional member
named \fB"keyRefTable"\fR, whose value is a table name. This
expresses the constraint that keys of the given <type> are UUIDs that
reference rows in the named table. This allows the IDL to supply a
structure pointer in place of a raw UUID in its marshalled version of
the given type.
.
.IP "\fB""valueRefTable""\fR member of <type>"
Analogous to \fB"keyRefTable"\fR in meaning and effect, except that it
applies to the \fB"value"\fR member of the <type>.
.SS "Commands"
.
.IP "\fBvalidate\fI schema\fR"
Reads \fIschema\fR and checks its format, without producing any output.
.
.IP "\fBovsdb\-schema\fI schema\fR"
Reads \fIschema\fR and prints it on standard output with the parts
that are not part of the OVSDB schema specification stripped out.
.
.IP "\fBc\-idl\-header\fI schema\fR"
Reads \fIschema\fR and prints on standard output a C header file that
defines a structure for each table defined by the schema.
.
.IP "\fBc\-idl\-source\fI schema\fR"
Reads \fIschema\fR and prints on standard output a C source file that
implements C bindings for the database defined by the schema.
.
.SS "Options"
.so lib/common.man
.
.SH "BUGS"
\fBovsdb\-idlc\fR is more lenient about the format of OVSDB schemas
than other OVSDB tools, so the \fBovsdb\-schema\fR command may output
schemas that other programs refuse to read.
.
.SH "SEE ALSO"
The OVSDB specification.
Loading

0 comments on commit d879a70

Please sign in to comment.