Skip to content

Commit

Permalink
vtep: Initial checkin of vtep schema.
Browse files Browse the repository at this point in the history
The hardware VTEP OVSDB schema specifies relations that a VTEP can use
to integrate physical ports into logical switches maintained by a
network virtualization controller such as NVP.

Co-authored-by: Ben Pfaff <[email protected]>
Co-authored-by: Kenneth Duda <[email protected]>
Co-authored-by: Justin Pettit <[email protected]>
Signed-off-by: Bruce Davie <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
Signed-off-by: Kenneth Duda <[email protected]>
Signed-off-by: Justin Pettit <[email protected]>
Acked-by: Ben Pfaff <[email protected]>
  • Loading branch information
4 people committed Oct 17, 2013
1 parent af4e1a4 commit add17b6
Show file tree
Hide file tree
Showing 8 changed files with 954 additions and 2 deletions.
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -274,3 +274,4 @@ include xenserver/automake.mk
include python/automake.mk
include python/compat/automake.mk
include tutorial/automake.mk
include vtep/automake.mk
3 changes: 3 additions & 0 deletions lib/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@
/vswitch-idl.c
/vswitch-idl.h
/vswitch-idl.ovsidl
/vtep-idl.c
/vtep-idl.h
/vtep-idl.ovsidl
17 changes: 15 additions & 2 deletions lib/automake.mk
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,9 @@ lib_libopenvswitch_a_SOURCES = \
lib/vlog.c \
lib/vlog.h \
lib/vswitch-idl.c \
lib/vswitch-idl.h
lib/vswitch-idl.h \
lib/vtep-idl.c \
lib/vtep-idl.h

nodist_lib_libopenvswitch_a_SOURCES = \
lib/dirs.c
Expand Down Expand Up @@ -334,7 +336,10 @@ MAN_FRAGMENTS += \
OVSIDL_BUILT += \
$(srcdir)/lib/vswitch-idl.c \
$(srcdir)/lib/vswitch-idl.h \
$(srcdir)/lib/vswitch-idl.ovsidl
$(srcdir)/lib/vswitch-idl.ovsidl \
$(srcdir)/lib/vtep-idl.c \
$(srcdir)/lib/vtep-idl.h \
$(srcdir)/lib/vtep-idl.ovsidl

EXTRA_DIST += $(srcdir)/lib/vswitch-idl.ann
VSWITCH_IDL_FILES = \
Expand All @@ -344,6 +349,14 @@ $(srcdir)/lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES)
$(OVSDB_IDLC) annotate $(VSWITCH_IDL_FILES) > $@.tmp
mv $@.tmp $@

EXTRA_DIST += $(srcdir)/lib/vtep-idl.ann
VTEP_IDL_FILES = \
$(srcdir)/vtep/vtep.ovsschema \
$(srcdir)/lib/vtep-idl.ann
$(srcdir)/lib/vtep-idl.ovsidl: $(VTEP_IDL_FILES)
$(OVSDB_IDLC) annotate $(VTEP_IDL_FILES) > $@.tmp
mv $@.tmp $@

lib/dirs.c: lib/dirs.c.in Makefile
($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
-e 's,[@]srcdir[@],$(srcdir),g' \
Expand Down
9 changes: 9 additions & 0 deletions lib/vtep-idl.ann
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# -*- python -*-

# This code, when invoked by "ovsdb-idlc annotate" (by the build
# process), annotates vswitch.ovsschema with additional data that give
# the ovsdb-idl engine information about the types involved, so that
# it can generate more programmer-friendly data structures.

s["idlPrefix"] = "vteprec_"
s["idlHeader"] = "\"lib/vtep-idl.h\""
6 changes: 6 additions & 0 deletions vtep/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/Makefile
/Makefile.in
/vtep.5
/vtep.gv
/vtep.ovsschema.stamp
/vtep.pic
46 changes: 46 additions & 0 deletions vtep/automake.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# VTEP schema and IDL
EXTRA_DIST += vtep/vtep.ovsschema
pkgdata_DATA += vtep/vtep.ovsschema

# VTEP E-R diagram
#
# If "python" or "dot" is not available, then we do not add graphical diagram
# to the documentation.
if HAVE_PYTHON
if HAVE_DOT
vtep/vtep.gv: ovsdb/ovsdb-dot.in vtep/vtep.ovsschema
$(OVSDB_DOT) --no-arrows $(srcdir)/vtep/vtep.ovsschema > $@
vtep/vtep.pic: vtep/vtep.gv ovsdb/dot2pic
(dot -T plain < vtep/vtep.gv | $(srcdir)/ovsdb/dot2pic -f 3) > $@;
VTEP_PIC = vtep/vtep.pic
VTEP_DOT_DIAGRAM_ARG = --er-diagram=$(VTEP_PIC)
DISTCLEANFILES += vtep/vtep.gv vtep/vtep.pic
endif
endif

# VTEP schema documentation
EXTRA_DIST += vtep/vtep.xml
DISTCLEANFILES += vtep/vtep.5
dist_man_MANS += vtep/vtep.5
$(srcdir)/vtep/vtep.5: \
ovsdb/ovsdb-doc vtep/vtep.xml vtep/vtep.ovsschema $(VTEP_PIC)
$(OVSDB_DOC) \
--title="vtep" \
$(VTEP_DOT_DIAGRAM_ARG) \
$(srcdir)/vtep/vtep.ovsschema \
$(srcdir)/vtep/vtep.xml > $@.tmp
mv $@.tmp $@

# Version checking for vtep.ovsschema.
ALL_LOCAL += vtep/vtep.ovsschema.stamp
vtep/vtep.ovsschema.stamp: vtep/vtep.ovsschema
@sum=`sed '/cksum/d' $? | cksum`; \
expected=`sed -n 's/.*"cksum": "\(.*\)".*/\1/p' $?`; \
if test "X$$sum" = "X$$expected"; then \
touch $@; \
else \
ln=`sed -n '/"cksum":/=' $?`; \
echo >&2 "$?:$$ln: checksum \"$$sum\" does not match (you should probably update the version number and fix the checksum)"; \
exit 1; \
fi
CLEANFILES += vtep/vtep.ovsschema.stamp
157 changes: 157 additions & 0 deletions vtep/vtep.ovsschema
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
{
"name": "hardware_vtep",
"cksum": "825115144 5318",
"tables": {
"Global": {
"columns": {
"managers": {
"type": {"key": {"type": "uuid",
"refTable": "Manager"},
"min": 0, "max": "unlimited"}},
"switches": {
"type": {"key": {"type": "uuid", "refTable": "Physical_Switch"},
"min": 0, "max": "unlimited"}}
},
"maxRows": 1,
"isRoot": true},
"Physical_Switch": {
"columns": {
"ports": {
"type": {"key": {"type": "uuid", "refTable": "Physical_Port"},
"min": 0, "max": "unlimited"}},
"name": {"type": "string"},
"description": {"type": "string"},
"management_ips": {
"type": {"key": {"type": "string"}, "min": 0, "max": "unlimited"}},
"tunnel_ips": {
"type": {"key": {"type": "string"}, "min": 0, "max": "unlimited"}}},
"indexes": [["name"]]},
"Physical_Port": {
"columns": {
"name": {"type": "string"},
"description": {"type": "string"},
"vlan_bindings": {
"type": {"key": {"type": "integer",
"minInteger": 0, "maxInteger": 4095},
"value": {"type": "uuid", "refTable": "Logical_Switch"},
"min": 0, "max": "unlimited"}},
"vlan_stats": {
"type": {"key": {"type": "integer",
"minInteger": 0, "maxInteger": 4095},
"value": {"type": "uuid",
"refTable": "Logical_Binding_Stats"},
"min": 0, "max": "unlimited"}}}},
"Logical_Binding_Stats": {
"columns": {
"bytes_from_local": {"type": "integer"},
"packets_from_local": {"type": "integer"},
"bytes_to_local": {"type": "integer"},
"packets_to_local": {"type": "integer"}}},
"Logical_Switch": {
"columns": {
"name": {"type": "string"},
"description": {"type": "string"},
"tunnel_key": {"type": {"key": "integer", "min": 0, "max": 1}}},
"isRoot": true,
"indexes": [["name"]]},
"Ucast_Macs_Local": {
"columns": {
"MAC": {"type": "string"},
"logical_switch": {
"type": {"key": {"type": "uuid",
"refTable": "Logical_Switch"}}},
"locator": {
"type": {"key": {"type": "uuid",
"refTable": "Physical_Locator"}}},
"ipaddr": {"type": "string"}},
"isRoot": true},
"Ucast_Macs_Remote": {
"columns": {
"MAC": {"type": "string"},
"logical_switch": {
"type": {"key": {"type": "uuid",
"refTable": "Logical_Switch"}}},
"locator": {
"type": {"key": {"type": "uuid",
"refTable": "Physical_Locator"}}},
"ipaddr": {"type": "string"}},
"isRoot": true},
"Mcast_Macs_Local": {
"columns": {
"MAC": {"type": "string"},
"logical_switch": {
"type": {"key": {"type": "uuid",
"refTable": "Logical_Switch"}}},
"locator_set": {
"type": {"key": {"type": "uuid",
"refTable": "Physical_Locator_Set"}}},
"ipaddr": {"type": "string"}},
"isRoot": true},
"Mcast_Macs_Remote": {
"columns": {
"MAC": {"type": "string"},
"logical_switch": {
"type": {"key": {"type": "uuid",
"refTable": "Logical_Switch"}}},
"locator_set": {
"type": {"key": {"type": "uuid",
"refTable": "Physical_Locator_Set"}}},
"ipaddr": {"type": "string"}},
"isRoot": true},
"Logical_Router": {
"columns": {
"name": {"type": "string"},
"description": {"type": "string"},
"switch_binding": {
"type": {"key": {"type": "string"},
"value": {"type": "uuid",
"refTable": "Logical_Switch"},
"min": 0, "max": "unlimited"}},
"static_routes": {
"type": {"key": {"type": "string"},
"value": {"type" : "string"},
"min": 0, "max": "unlimited"}}},
"isRoot": true,
"indexes": [["name"]]},
"Physical_Locator_Set": {
"columns": {
"locators": {
"type": {"key": {"type": "uuid", "refTable": "Physical_Locator"},
"min": 1, "max": "unlimited"},
"mutable": false}}},
"Physical_Locator": {
"columns": {
"encapsulation_type": {
"type": {
"key": {
"enum": ["set", ["vxlan_over_ipv4"]],
"type": "string"}},
"mutable": false},
"dst_ip": {"type": "string", "mutable": false},
"bfd": {
"type": {"key": "string", "value": "string",
"min": 0, "max": "unlimited"}},
"bfd_status": {
"type": {"key": "string", "value": "string",
"min": 0, "max": "unlimited"}}},
"indexes": [["encapsulation_type", "dst_ip"]]},
"Manager": {
"columns": {
"target": {"type": "string"},
"max_backoff": {
"type": {"key": {"type": "integer",
"minInteger": 1000},
"min": 0, "max": 1}},
"inactivity_probe": {
"type": {"key": "integer", "min": 0, "max": 1}},
"other_config": {
"type": {"key": "string", "value": "string", "min": 0, "max": "unlimited"}},
"is_connected": {
"type": "boolean",
"ephemeral": true},
"status": {
"type": {"key": "string", "value": "string", "min": 0, "max": "unlimited"},
"ephemeral": true}},
"indexes": [["target"]],
"isRoot": false}},
"version": "1.0.0"}
Loading

0 comments on commit add17b6

Please sign in to comment.