Permalink
Browse files

Merge pull request #1654 from Kentzo/vmci

Add the VMCI transport.
  • Loading branch information...
2 parents 61f74e2 + 68b13fb commit fc7e3bc3a49a0b5e8d257bc1b415743772ccb4e6 @hintjens hintjens committed Dec 8, 2015
View
@@ -53,6 +53,7 @@ Gonzalo Diethelm
Guido Goldstein
Ian Barber
Ilja Golshtein
+Ilya Kulakov
Ivo Danihelka
Jacob Rideout
Joe Thornber
View
@@ -6,6 +6,7 @@ project(ZeroMQ)
list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_SOURCE_DIR}")
option(WITH_OPENPGM "Build with support for OpenPGM" OFF)
+option(WITH_VMCI "Build with support for VMware VMCI socket" OFF)
if(APPLE)
option(ZMQ_BUILD_FRAMEWORK "Build as OS X framework" ON)
@@ -502,6 +503,12 @@ if(WITH_OPENPGM)
set(OPTIONAL_LIBRARIES ${OPENPGM_LIBRARIES})
endif(WITH_OPENPGM)
+if(WITH_VMCI)
+ add_definitions(-DZMQ_HAVE_VMCI)
+ include_directories(${VMCI_INCLUDE_DIRS})
+ list(APPEND cxx-sources vmci_address.cpp vmci_connecter.cpp vmci_listener.cpp vmci.cpp)
+endif(WITH_VMCI)
+
#-----------------------------------------------------------------------------
# source generators
View
@@ -196,6 +196,14 @@ src_libzmq_la_SOURCES = \
src/v2_encoder.cpp \
src/v2_encoder.hpp \
src/v2_protocol.hpp \
+ src/vmci.cpp \
+ src/vmci.hpp \
+ src/vmci_address.cpp \
+ src/vmci_address.hpp \
+ src/vmci_connecter.cpp \
+ src/vmci_connecter.hpp \
+ src/vmci_listener.cpp \
+ src/vmci_listener.hpp \
src/windows.hpp \
src/wire.hpp \
src/xpub.hpp \
@@ -663,6 +671,21 @@ tests_test_abstract_ipc_LDADD = src/libzmq.la
endif
+if HAVE_VMCI
+test_apps += test_pair_vmci test_reqrep_vmci
+
+test_pair_vmci_SOURCES = tests/test_pair_vmci.cpp
+test_pair_vmci_LDADD = libzmq.la
+test_pair_vmci_LDFLAGS = @LIBZMQ_VMCI_LDFLAGS@
+test_pair_vmci_CXXFLAGS = @LIBZMQ_VMCI_CXXFLAGS@
+
+test_reqrep_vmci_SOURCES = tests/test_reqrep_vmci.cpp
+test_reqrep_vmci_LDADD = libzmq.la
+test_reqrep_vmci_LDFLAGS = @LIBZMQ_VMCI_LDFLAGS@
+test_reqrep_vmci_CXXFLAGS = @LIBZMQ_VMCI_CXXFLAGS@
+
+endif
+
check_PROGRAMS = ${test_apps}
# Run the test cases
View
@@ -488,6 +488,28 @@ if test "x$with_norm_ext" != "xno"; then
LIBS="-lnorm $LIBS"
fi
+# build using vmci
+have_vmci_library="no"
+
+AC_ARG_WITH([vmci], [AS_HELP_STRING([--with-vmci],
+ [build libzmq with VMCI transport [default=no]])],
+ [have_vmci_ext=$withval],
+ [have_vmci_ext=yes])
+
+if test "x$have_vmci_ext" != "xno"; then
+ AC_DEFINE(ZMQ_HAVE_VMCI, 1, [Have VMCI transport])
+
+ if test "x$have_vmci_ext" != "xyes"; then
+ vmci_path="${have_vmci_ext}"
+ LIBZMQ_VMCI_CXXFLAGS="-I${vmci_path}"
+ LIBZMQ_VMCI_LDFLAGS="-I${vmci_path}"
+ LIBZMQ_EXTRA_CXXFLAGS="${LIBZMQ_VMCI_CXXFLAGS} ${LIBZMQ_EXTRA_CXXFLAGS}"
+ LIBZMQ_EXTRA_LDFLAGS="${LIBZMQ_VMCI_LDFLAGS} ${LIBZMQ_EXTRA_LDFLAGS}"
+ fi
+fi
+
+AM_CONDITIONAL(HAVE_VMCI, test "x$have_vmci_ext" != "xno")
+
# Set -Wall, -Werror and -pedantic
AC_LANG_PUSH([C++])
@@ -567,6 +589,9 @@ AC_SUBST(LIBZMQ_EXTRA_CFLAGS)
AC_SUBST(LIBZMQ_EXTRA_CXXFLAGS)
AC_SUBST(LIBZMQ_EXTRA_LDFLAGS)
+AC_SUBST(LIBZMQ_VMCI_CXXFLAGS)
+AC_SUBST(LIBZMQ_VMCI_LDFLAGS)
+
# set pkgconfigdir, allow override
AC_ARG_WITH([pkgconfigdir],
AS_HELP_STRING([--with-pkgconfigdir=PATH],
View
@@ -21,7 +21,7 @@ MAN3 = zmq_bind.3 zmq_unbind.3 zmq_connect.3 zmq_disconnect.3 zmq_close.3 \
zmq_atomic_counter_value.3 zmq_atomic_counter_destroy.3
MAN7 = zmq.7 zmq_tcp.7 zmq_pgm.7 zmq_inproc.7 zmq_ipc.7 \
- zmq_null.7 zmq_plain.7 zmq_curve.7 zmq_tipc.7
+ zmq_null.7 zmq_plain.7 zmq_curve.7 zmq_tipc.7 zmq_vmci.7
MAN_DOC = $(MAN1) $(MAN3) $(MAN7)
View
@@ -162,6 +162,9 @@ Local inter-process communication transport::
Local in-process (inter-thread) communication transport::
linkzmq:zmq_inproc[7]
+Virtual Machine Communications Interface (VMC) transport::
+ linkzmq:zmq_vmci[7]
+
Proxies
~~~~~~~
View
@@ -27,13 +27,14 @@ The 'endpoint' is a string consisting of a 'transport'`://` followed by an
'ipc':: local inter-process communication transport, see linkzmq:zmq_ipc[7]
'inproc':: local in-process (inter-thread) communication transport, see linkzmq:zmq_inproc[7]
'pgm', 'epgm':: reliable multicast transport using PGM, see linkzmq:zmq_pgm[7]
+'vmci':: virtual machine communications interface (VMCI), see linkzmq:zmq_vmci[7]
Every 0MQ socket type except 'ZMQ_PAIR' supports one-to-many and many-to-one
semantics. The precise semantics depend on the socket type and are defined in
linkzmq:zmq_socket[3].
-The 'ipc' and 'tcp' transports accept wildcard addresses: see linkzmq:zmq_ipc[7]
-and linkzmq:zmq_tcp[7] for details.
+The 'ipc', 'tcp' and 'vmci' transports accept wildcard addresses: see linkzmq:zmq_ipc[7],
+linkzmq:zmq_tcp[7] and linkzmq:zmq_vmci[7] for details.
NOTE: the address syntax may be different for _zmq_bind()_ and _zmq_connect()_
especially for the 'tcp', 'pgm' and 'epgm' transports.
View
@@ -27,6 +27,7 @@ The 'endpoint' is a string consisting of a 'transport'`://` followed by an
'ipc':: local inter-process communication transport, see linkzmq:zmq_ipc[7]
'inproc':: local in-process (inter-thread) communication transport, see linkzmq:zmq_inproc[7]
'pgm', 'epgm':: reliable multicast transport using PGM, see linkzmq:zmq_pgm[7]
+'vmci':: virtual machine communications interface (VMCI), see linkzmq:zmq_vmci[7]
Every 0MQ socket type except 'ZMQ_PAIR' supports one-to-many and many-to-one
semantics. The precise semantics depend on the socket type and are defined in
View
@@ -777,6 +777,54 @@ Option value unit:: >0
Default value:: 8192
Applicable socket types:: all, when using TCP transport
+ZMQ_VMCI_BUFFER_SIZE: Retrieve buffer size of the VMCI socket
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The `ZMQ_VMCI_BUFFER_SIZE` option shall retrieve the size of the underlying
+buffer for the socket. Used during negotiation before the connection is established.
+
+[horizontal]
+Option value type:: uint64_t
+Option value unit:: bytes
+Default value:: 65546
+Applicable socket types:: all, when using VMCI transport
+
+
+ZMQ_VMCI_BUFFER_MIN_SIZE: Retrieve min buffer size of the VMCI socket
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The `ZMQ_VMCI_BUFFER_MIN_SIZE` option shall retrieve the min size of the underlying
+buffer for the socket. Used during negotiation before the connection is established.
+
+[horizontal]
+Option value type:: uint64_t
+Option value unit:: bytes
+Default value:: 128
+Applicable socket types:: all, when using VMCI transport
+
+
+ZMQ_VMCI_BUFFER_MAX_SIZE: Retrieve max buffer size of the VMCI socket
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The `ZMQ_VMCI_BUFFER_MAX_SIZE` option shall retrieve the max size of the underlying
+buffer for the socket. Used during negotiation before the connection is established.
+
+[horizontal]
+Option value type:: uint64_t
+Option value unit:: bytes
+Default value:: 262144
+Applicable socket types:: all, when using VMCI transport
+
+
+ZMQ_VMCI_CONNECT_TIMEOUT: Retrieve connection timeout of the VMCI socket
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The `ZMQ_VMCI_CONNECT_TIMEOUT` option shall retrieve connection timeout
+for the socket.
+
+[horizontal]
+Option value type:: int
+Option value unit:: milliseconds
+Default value:: -1
+Applicable socket types:: all, when using VMCI transport
+
+
RETURN VALUE
------------
The _zmq_getsockopt()_ function shall return zero if successful. Otherwise it
View
@@ -78,6 +78,7 @@ linkzmq:zmq_connect[3]
linkzmq:zmq_ipc[7]
linkzmq:zmq_tcp[7]
linkzmq:zmq_pgm[7]
+linkzmq:zmq_vmci[7]
linkzmq:zmq[7]
View
@@ -95,6 +95,7 @@ linkzmq:zmq_connect[3]
linkzmq:zmq_inproc[7]
linkzmq:zmq_tcp[7]
linkzmq:zmq_pgm[7]
+linkzmq:zmq_vmci[7]
linkzmq:zmq_getsockopt[3]
linkzmq:zmq[7]
View
@@ -154,6 +154,7 @@ linkzmq:zmq_setsockopt[3]
linkzmq:zmq_tcp[7]
linkzmq:zmq_ipc[7]
linkzmq:zmq_inproc[7]
+linkzmq:zmq_vmci[7]
linkzmq:zmq[7]
View
@@ -1112,6 +1112,54 @@ Option value unit:: >0
Default value:: 8192
Applicable socket types:: all, when using TCP transport
+ZMQ_VMCI_BUFFER_SIZE: Set buffer size of the VMCI socket
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The `ZMQ_VMCI_BUFFER_SIZE` option shall set the size of the underlying
+buffer for the socket. Used during negotiation before the connection is established.
+
+[horizontal]
+Option value type:: uint64_t
+Option value unit:: bytes
+Default value:: 65546
+Applicable socket types:: all, when using VMCI transport
+
+
+ZMQ_VMCI_BUFFER_MIN_SIZE: Set min buffer size of the VMCI socket
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The `ZMQ_VMCI_BUFFER_MIN_SIZE` option shall set the min size of the underlying
+buffer for the socket. Used during negotiation before the connection is established.
+
+[horizontal]
+Option value type:: uint64_t
+Option value unit:: bytes
+Default value:: 128
+Applicable socket types:: all, when using VMCI transport
+
+
+ZMQ_VMCI_BUFFER_MAX_SIZE: Set max buffer size of the VMCI socket
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The `ZMQ_VMCI_BUFFER_MAX_SIZE` option shall set the max size of the underlying
+buffer for the socket. Used during negotiation before the connection is established.
+
+[horizontal]
+Option value type:: uint64_t
+Option value unit:: bytes
+Default value:: 262144
+Applicable socket types:: all, when using VMCI transport
+
+
+ZMQ_VMCI_CONNECT_TIMEOUT: Set connection timeout of the VMCI socket
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The `ZMQ_VMCI_CONNECT_TIMEOUT` option shall set connection timeout
+for the socket.
+
+[horizontal]
+Option value type:: int
+Option value unit:: milliseconds
+Default value:: -1
+Applicable socket types:: all, when using VMCI transport
+
+
RETURN VALUE
------------
The _zmq_setsockopt()_ function shall return zero if successful. Otherwise it
View
@@ -108,6 +108,7 @@ linkzmq:zmq_connect[3]
linkzmq:zmq_pgm[7]
linkzmq:zmq_ipc[7]
linkzmq:zmq_inproc[7]
+linkzmq:zmq_vmci[7]
linkzmq:zmq[7]
View
@@ -73,6 +73,7 @@ linkzmq:zmq_tcp[7]
linkzmq:zmq_pgm[7]
linkzmq:zmq_ipc[7]
linkzmq:zmq_inproc[7]
+linkzmq:zmq_vmci[7]
linkzmq:zmq[7]
View
@@ -21,10 +21,10 @@ argument.
The 'endpoint' argument is as described in linkzmq:zmq_bind[3]
Unbinding wild-card address from a socket
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-When wild-card `*` 'endpoint' (described in linkzmq:zmq_tcp[7] and
-linkzmq:zmq_ipc[7]) was used in _zmq_bind()_, the caller should use
-real 'endpoint' obtained from the ZMQ_LAST_ENDPOINT socket option
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+When wild-card `*` 'endpoint' (described in linkzmq:zmq_tcp[7],
+linkzmq:zmq_ipc[7] and linkzmq:zmq_vmci[7]) was used in _zmq_bind()_, the caller should use
+real 'endpoint' obtained from the ZMQ_LAST_ENDPOINT socket option
to unbind this 'endpoint' from a socket.
RETURN VALUE
Oops, something went wrong.

0 comments on commit fc7e3bc

Please sign in to comment.