rbczmq 1.7.1 → 1.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/.gitmodules +1 -1
- data/CHANGELOG.rdoc +4 -0
- data/Gemfile.lock +1 -1
- data/README.rdoc +5 -4
- data/ext/czmq/.gitignore +5 -0
- data/ext/czmq/.travis.yml +10 -1
- data/ext/czmq/AUTHORS +2 -0
- data/ext/czmq/COPYING.LESSER +3 -0
- data/ext/czmq/Makefile.am +13 -3
- data/ext/czmq/NEWS +132 -0
- data/ext/czmq/README.md +1553 -615
- data/ext/czmq/README.txt +188 -72
- data/ext/czmq/addons/Makefile.am +9 -0
- data/ext/czmq/addons/makecert.c +72 -0
- data/ext/czmq/builds/mingw32/Makefile.mingw32 +11 -3
- data/ext/czmq/builds/msvc/.gitignore +4 -1
- data/ext/czmq/builds/msvc/czmq.vcproj +4 -0
- data/ext/czmq/builds/msvc/czmq.vcxproj +6 -1
- data/ext/czmq/builds/msvc/czmq.vcxproj.filters +4 -1
- data/ext/{zeromq/cmake/Modules/zmq_version.cpp → czmq/builds/msvc/platform.h} +10 -9
- data/ext/czmq/configure.ac +64 -5
- data/ext/czmq/doc/Makefile.am +8 -1
- data/ext/czmq/doc/mkmans +17 -0
- data/ext/czmq/doc/zauth.txt +191 -0
- data/ext/czmq/doc/zbeacon.txt +13 -22
- data/ext/czmq/doc/zcert.txt +122 -0
- data/ext/czmq/doc/zcertstore.txt +107 -0
- data/ext/czmq/doc/zchunk.txt +77 -0
- data/ext/czmq/doc/zclock.txt +8 -0
- data/ext/czmq/doc/zconfig.txt +9 -63
- data/ext/czmq/doc/zctx.txt +26 -7
- data/ext/czmq/doc/zdir.txt +83 -0
- data/ext/czmq/doc/zfile.txt +130 -35
- data/ext/czmq/doc/zframe.txt +6 -39
- data/ext/czmq/doc/zhash.txt +55 -10
- data/ext/czmq/doc/zlist.txt +2 -4
- data/ext/czmq/doc/zloop.txt +7 -1
- data/ext/czmq/doc/zmsg.txt +75 -32
- data/ext/czmq/doc/zpoller.txt +88 -0
- data/ext/czmq/doc/zsocket.txt +50 -1
- data/ext/czmq/doc/zsockopt.txt +185 -251
- data/ext/czmq/doc/zstr.txt +14 -3
- data/ext/czmq/doc/zsys.txt +89 -1
- data/ext/czmq/doc/ztree.txt +21 -11
- data/ext/czmq/examples/security/LICENSE +18 -0
- data/ext/czmq/examples/security/README.txt +9 -0
- data/ext/czmq/examples/security/grasslands.c +29 -0
- data/ext/czmq/examples/security/hello.c +10 -0
- data/ext/czmq/examples/security/ironhouse.c +55 -0
- data/ext/czmq/examples/security/ironhouse2.c +103 -0
- data/ext/czmq/examples/security/stonehouse.c +51 -0
- data/ext/czmq/examples/security/strawhouse.c +44 -0
- data/ext/czmq/examples/security/woodhouse.c +40 -0
- data/ext/czmq/images/README_1.png +0 -0
- data/ext/czmq/images/README_2.png +0 -0
- data/ext/czmq/include/czmq.h +10 -4
- data/ext/czmq/include/czmq_prelude.h +42 -42
- data/ext/czmq/include/zauth.h +97 -0
- data/ext/czmq/include/zbeacon.h +0 -5
- data/ext/czmq/include/zcert.h +118 -0
- data/ext/czmq/include/zcertstore.h +78 -0
- data/ext/czmq/include/zchunk.h +87 -0
- data/ext/czmq/include/zclock.h +4 -0
- data/ext/czmq/include/zconfig.h +21 -12
- data/ext/czmq/include/zctx.h +34 -11
- data/ext/czmq/include/zdir.h +90 -0
- data/ext/czmq/include/zfile.h +104 -25
- data/ext/czmq/include/zframe.h +7 -20
- data/ext/czmq/include/zhash.h +13 -0
- data/ext/czmq/include/zlist.h +0 -4
- data/ext/czmq/include/zloop.h +5 -5
- data/ext/czmq/include/zmsg.h +59 -29
- data/ext/czmq/include/zmutex.h +5 -0
- data/ext/czmq/include/zpoller.h +72 -0
- data/ext/czmq/include/zsocket.h +12 -15
- data/ext/czmq/include/zsockopt.h +124 -121
- data/ext/czmq/include/zstr.h +12 -9
- data/ext/czmq/include/zsys.h +50 -2
- data/ext/czmq/mkdoc +1 -1
- data/ext/czmq/model/sockopts.xml +101 -21
- data/ext/czmq/scripts/sockopts.gsl +95 -41
- data/ext/czmq/src/Makefile.am +13 -0
- data/ext/czmq/src/czmq_selftest.c +16 -10
- data/ext/czmq/src/selftest +2 -2
- data/ext/czmq/src/zauth.c +714 -0
- data/ext/czmq/src/zbeacon.c +27 -35
- data/ext/czmq/src/zcert.c +463 -0
- data/ext/czmq/src/zcertstore.c +265 -0
- data/ext/czmq/src/zchunk.c +207 -0
- data/ext/czmq/src/zclock.c +18 -0
- data/ext/czmq/src/zconfig.c +116 -99
- data/ext/czmq/src/zctx.c +103 -18
- data/ext/czmq/src/zdir.c +409 -0
- data/ext/czmq/src/zfile.c +421 -130
- data/ext/czmq/src/zframe.c +28 -127
- data/ext/czmq/src/zhash.c +255 -139
- data/ext/czmq/src/zlist.c +2 -8
- data/ext/czmq/src/zloop.c +40 -13
- data/ext/czmq/src/zmsg.c +109 -141
- data/ext/czmq/src/zmutex.c +27 -1
- data/ext/czmq/src/zpoller.c +218 -0
- data/ext/czmq/src/zsocket.c +53 -66
- data/ext/czmq/src/zsockopt.c +2337 -682
- data/ext/czmq/src/zstr.c +48 -118
- data/ext/czmq/src/zsys.c +270 -3
- data/ext/czmq/src/zthread.c +2 -2
- data/ext/czmq/src/ztree.c +179 -180
- data/ext/rbczmq/beacon.c +1 -1
- data/ext/rbczmq/context.c +12 -3
- data/ext/rbczmq/context.h +7 -0
- data/ext/rbczmq/extconf.rb +13 -4
- data/ext/rbczmq/pollitem.c +1 -1
- data/ext/rbczmq/socket.c +34 -24
- data/ext/rbczmq/socket.h +3 -2
- data/ext/zeromq/AUTHORS +17 -3
- data/ext/zeromq/CMakeLists.txt +742 -339
- data/ext/zeromq/COPYING.LESSER +2 -0
- data/ext/zeromq/Makefile.am +3 -3
- data/ext/zeromq/NEWS +130 -1
- data/ext/zeromq/{README → README.md} +8 -9
- data/ext/zeromq/builds/cmake/Modules/FindAsciiDoc.cmake +24 -0
- data/ext/zeromq/builds/cmake/Modules/TestZMQVersion.cmake +18 -0
- data/ext/zeromq/builds/cmake/Modules/ZMQSourceRunChecks.cmake +129 -0
- data/ext/zeromq/{cmake → builds/cmake}/NSIS.template32.in +1 -1
- data/ext/zeromq/{cmake → builds/cmake}/NSIS.template64.in +1 -1
- data/ext/zeromq/builds/cmake/platform.hpp.in +88 -0
- data/ext/zeromq/builds/mingw32/Makefile.mingw32 +47 -0
- data/ext/zeromq/{src/i_msg_sink.hpp → builds/mingw32/platform.hpp} +10 -21
- data/ext/zeromq/builds/msvc/Makefile.am +5 -2
- data/ext/zeromq/builds/msvc/c_local_lat/c_local_lat.vcxproj +1 -1
- data/ext/zeromq/builds/msvc/c_local_lat/c_local_lat11.vcxproj +91 -0
- data/ext/zeromq/builds/msvc/c_local_thr/c_local_thr.vcproj +2 -0
- data/ext/zeromq/builds/msvc/c_local_thr/c_local_thr.vcxproj +21 -1
- data/ext/zeromq/builds/msvc/c_local_thr/c_local_thr11.vcxproj +111 -0
- data/ext/zeromq/builds/msvc/c_remote_lat/c_remote_lat.vcxproj +1 -1
- data/ext/zeromq/builds/msvc/c_remote_lat/c_remote_lat11.vcxproj +91 -0
- data/ext/zeromq/builds/msvc/c_remote_thr/c_remote_thr.vcproj +2 -0
- data/ext/zeromq/builds/msvc/c_remote_thr/c_remote_thr.vcxproj +21 -1
- data/ext/zeromq/builds/msvc/c_remote_thr/c_remote_thr11.vcxproj +111 -0
- data/ext/zeromq/builds/msvc/errno.cpp +1 -1
- data/ext/zeromq/builds/msvc/errno.hpp +1 -1
- data/ext/zeromq/builds/msvc/inproc_lat/inproc_lat.vcproj +176 -174
- data/ext/zeromq/builds/msvc/inproc_lat/inproc_lat.vcxproj +21 -1
- data/ext/zeromq/builds/msvc/inproc_lat/inproc_lat11.vcxproj +110 -0
- data/ext/zeromq/builds/msvc/inproc_thr/inproc_thr.vcproj +176 -174
- data/ext/zeromq/builds/msvc/inproc_thr/inproc_thr.vcxproj +21 -1
- data/ext/zeromq/builds/msvc/inproc_thr/inproc_thr11.vcxproj +110 -0
- data/ext/zeromq/builds/msvc/libzmq/libzmq.vcproj +997 -804
- data/ext/zeromq/builds/msvc/libzmq/libzmq.vcxproj +78 -2
- data/ext/zeromq/builds/msvc/libzmq/libzmq.vcxproj.filters +42 -6
- data/ext/zeromq/builds/msvc/libzmq/libzmq11.vcxproj +362 -0
- data/ext/zeromq/builds/msvc/msvc.sln +6 -0
- data/ext/zeromq/builds/msvc/msvc10.sln +36 -2
- data/ext/zeromq/builds/msvc/msvc11.sln +150 -0
- data/ext/zeromq/builds/msvc/properties/Static.props +15 -0
- data/ext/zeromq/builds/msvc/properties/ZeroMQ.props +0 -1
- data/ext/zeromq/builds/msvc/properties/ZeroMQ_Static.props +23 -0
- data/ext/zeromq/builds/redhat/zeromq.spec.in +2 -1
- data/ext/zeromq/{configure.in → configure.ac} +74 -15
- data/ext/zeromq/doc/Makefile.am +6 -4
- data/ext/zeromq/doc/zmq.txt +30 -3
- data/ext/zeromq/doc/zmq_bind.txt +2 -2
- data/ext/zeromq/doc/zmq_close.txt +2 -2
- data/ext/zeromq/doc/zmq_connect.txt +9 -7
- data/ext/zeromq/doc/zmq_ctx_destroy.txt +4 -3
- data/ext/zeromq/doc/zmq_ctx_get.txt +8 -3
- data/ext/zeromq/doc/zmq_ctx_new.txt +3 -2
- data/ext/zeromq/doc/zmq_ctx_set.txt +13 -1
- data/ext/zeromq/doc/zmq_ctx_shutdown.txt +52 -0
- data/ext/zeromq/doc/zmq_ctx_term.txt +67 -0
- data/ext/zeromq/doc/zmq_curve.txt +92 -0
- data/ext/zeromq/doc/zmq_curve_keypair.txt +56 -0
- data/ext/zeromq/doc/zmq_disconnect.txt +2 -2
- data/ext/zeromq/doc/zmq_epgm.txt +5 -4
- data/ext/zeromq/doc/zmq_errno.txt +2 -2
- data/ext/zeromq/doc/zmq_getsockopt.txt +149 -24
- data/ext/zeromq/doc/zmq_init.txt +2 -2
- data/ext/zeromq/doc/zmq_inproc.txt +2 -2
- data/ext/zeromq/doc/zmq_ipc.txt +10 -5
- data/ext/zeromq/doc/zmq_msg_close.txt +4 -3
- data/ext/zeromq/doc/zmq_msg_copy.txt +2 -2
- data/ext/zeromq/doc/zmq_msg_data.txt +2 -2
- data/ext/zeromq/doc/zmq_msg_get.txt +3 -3
- data/ext/zeromq/doc/zmq_msg_init.txt +2 -2
- data/ext/zeromq/doc/zmq_msg_init_data.txt +2 -2
- data/ext/zeromq/doc/zmq_msg_init_size.txt +2 -2
- data/ext/zeromq/doc/zmq_msg_more.txt +6 -4
- data/ext/zeromq/doc/zmq_msg_move.txt +2 -2
- data/ext/zeromq/doc/zmq_msg_recv.txt +3 -4
- data/ext/zeromq/doc/zmq_msg_send.txt +10 -7
- data/ext/zeromq/doc/zmq_msg_set.txt +2 -1
- data/ext/zeromq/doc/zmq_msg_size.txt +2 -2
- data/ext/zeromq/doc/zmq_null.txt +27 -0
- data/ext/zeromq/doc/zmq_pgm.txt +5 -4
- data/ext/zeromq/doc/zmq_plain.txt +37 -0
- data/ext/zeromq/doc/zmq_poll.txt +2 -6
- data/ext/zeromq/doc/zmq_proxy.txt +2 -1
- data/ext/zeromq/doc/zmq_recv.txt +2 -5
- data/ext/zeromq/doc/zmq_recvmsg.txt +3 -5
- data/ext/zeromq/doc/zmq_send.txt +9 -7
- data/ext/zeromq/doc/zmq_send_const.txt +103 -0
- data/ext/zeromq/doc/zmq_sendmsg.txt +8 -8
- data/ext/zeromq/doc/zmq_setsockopt.txt +291 -37
- data/ext/zeromq/doc/zmq_socket.txt +92 -21
- data/ext/zeromq/doc/zmq_socket_monitor.txt +102 -131
- data/ext/zeromq/doc/zmq_strerror.txt +3 -2
- data/ext/zeromq/doc/zmq_tcp.txt +4 -2
- data/ext/zeromq/doc/zmq_term.txt +3 -3
- data/ext/zeromq/doc/zmq_unbind.txt +2 -2
- data/ext/zeromq/doc/zmq_version.txt +3 -2
- data/ext/zeromq/doc/zmq_z85_decode.txt +50 -0
- data/ext/zeromq/doc/zmq_z85_encode.txt +57 -0
- data/ext/zeromq/foreign/openpgm/libpgm-5.2.122~dfsg.tar.gz +0 -0
- data/ext/zeromq/include/zmq.h +179 -136
- data/ext/zeromq/include/zmq_utils.h +44 -3
- data/ext/zeromq/perf/inproc_lat.cpp +2 -4
- data/ext/zeromq/perf/inproc_thr.cpp +1 -1
- data/ext/zeromq/perf/local_lat.cpp +1 -3
- data/ext/zeromq/perf/local_thr.cpp +1 -3
- data/ext/zeromq/perf/remote_lat.cpp +1 -3
- data/ext/zeromq/perf/remote_thr.cpp +1 -8
- data/ext/zeromq/src/Makefile.am +26 -7
- data/ext/zeromq/src/address.cpp +7 -8
- data/ext/zeromq/src/address.hpp +1 -2
- data/ext/zeromq/src/array.hpp +1 -3
- data/ext/zeromq/src/atomic_counter.hpp +11 -3
- data/ext/zeromq/src/atomic_ptr.hpp +9 -3
- data/ext/zeromq/src/blob.hpp +2 -2
- data/ext/zeromq/src/clock.cpp +3 -4
- data/ext/zeromq/src/clock.hpp +1 -2
- data/ext/zeromq/src/command.hpp +2 -3
- data/ext/zeromq/src/config.hpp +1 -3
- data/ext/zeromq/src/ctx.cpp +154 -15
- data/ext/zeromq/src/ctx.hpp +34 -3
- data/ext/zeromq/src/curve_client.cpp +410 -0
- data/ext/zeromq/src/curve_client.hpp +109 -0
- data/ext/zeromq/src/curve_server.cpp +629 -0
- data/ext/zeromq/src/curve_server.hpp +120 -0
- data/ext/zeromq/src/dbuffer.hpp +134 -0
- data/ext/zeromq/src/dealer.cpp +52 -60
- data/ext/zeromq/src/dealer.hpp +12 -26
- data/ext/zeromq/src/decoder.hpp +27 -102
- data/ext/zeromq/src/devpoll.cpp +1 -3
- data/ext/zeromq/src/devpoll.hpp +1 -3
- data/ext/zeromq/src/dist.cpp +17 -15
- data/ext/zeromq/src/dist.hpp +5 -6
- data/ext/zeromq/src/encoder.hpp +32 -52
- data/ext/zeromq/src/epoll.cpp +1 -3
- data/ext/zeromq/src/epoll.hpp +1 -3
- data/ext/zeromq/src/err.cpp +2 -4
- data/ext/zeromq/src/err.hpp +7 -4
- data/ext/zeromq/src/fd.hpp +1 -2
- data/ext/zeromq/src/fq.cpp +2 -5
- data/ext/zeromq/src/fq.hpp +2 -4
- data/ext/zeromq/src/i_decoder.hpp +11 -9
- data/ext/zeromq/src/i_encoder.hpp +7 -11
- data/ext/zeromq/src/i_engine.hpp +3 -3
- data/ext/zeromq/src/i_poll_events.hpp +1 -3
- data/ext/zeromq/src/io_object.cpp +1 -3
- data/ext/zeromq/src/io_object.hpp +1 -3
- data/ext/zeromq/src/io_thread.cpp +1 -3
- data/ext/zeromq/src/io_thread.hpp +1 -3
- data/ext/zeromq/src/ip.cpp +46 -5
- data/ext/zeromq/src/ip.hpp +7 -4
- data/ext/zeromq/src/ipc_address.cpp +13 -2
- data/ext/zeromq/src/ipc_address.hpp +1 -2
- data/ext/zeromq/src/ipc_connecter.cpp +3 -3
- data/ext/zeromq/src/ipc_connecter.hpp +1 -2
- data/ext/zeromq/src/ipc_listener.cpp +15 -10
- data/ext/zeromq/src/ipc_listener.hpp +1 -2
- data/ext/zeromq/src/kqueue.cpp +11 -3
- data/ext/zeromq/src/kqueue.hpp +7 -3
- data/ext/zeromq/src/lb.cpp +13 -11
- data/ext/zeromq/src/lb.hpp +10 -5
- data/ext/zeromq/src/libzmq.pc.cmake.in +10 -0
- data/ext/zeromq/src/likely.hpp +1 -2
- data/ext/zeromq/src/mailbox.cpp +1 -4
- data/ext/zeromq/src/mailbox.hpp +8 -3
- data/ext/zeromq/src/mechanism.cpp +163 -0
- data/ext/zeromq/src/mechanism.hpp +101 -0
- data/ext/zeromq/src/msg.cpp +38 -18
- data/ext/zeromq/src/msg.hpp +19 -7
- data/ext/zeromq/src/mtrie.cpp +16 -14
- data/ext/zeromq/src/mtrie.hpp +1 -3
- data/ext/zeromq/src/mutex.hpp +42 -3
- data/ext/zeromq/src/null_mechanism.cpp +282 -0
- data/ext/zeromq/src/null_mechanism.hpp +65 -0
- data/ext/zeromq/src/object.cpp +29 -3
- data/ext/zeromq/src/object.hpp +8 -5
- data/ext/zeromq/src/options.cpp +557 -485
- data/ext/zeromq/src/options.hpp +38 -24
- data/ext/zeromq/src/own.cpp +1 -2
- data/ext/zeromq/src/own.hpp +1 -2
- data/ext/zeromq/src/pair.cpp +8 -25
- data/ext/zeromq/src/pair.hpp +5 -22
- data/ext/zeromq/src/pgm_receiver.cpp +80 -67
- data/ext/zeromq/src/pgm_receiver.hpp +11 -10
- data/ext/zeromq/src/pgm_sender.cpp +37 -16
- data/ext/zeromq/src/pgm_sender.hpp +12 -6
- data/ext/zeromq/src/pgm_socket.cpp +8 -8
- data/ext/zeromq/src/pgm_socket.hpp +1 -4
- data/ext/zeromq/src/pipe.cpp +110 -72
- data/ext/zeromq/src/pipe.hpp +36 -27
- data/ext/zeromq/src/plain_mechanism.cpp +482 -0
- data/ext/zeromq/src/plain_mechanism.hpp +88 -0
- data/ext/zeromq/src/poll.cpp +1 -3
- data/ext/zeromq/src/poll.hpp +1 -3
- data/ext/zeromq/src/poller.hpp +1 -3
- data/ext/zeromq/src/poller_base.cpp +3 -3
- data/ext/zeromq/src/poller_base.hpp +1 -2
- data/ext/zeromq/src/precompiled.cpp +1 -2
- data/ext/zeromq/src/precompiled.hpp +1 -2
- data/ext/zeromq/src/proxy.cpp +1 -2
- data/ext/zeromq/src/proxy.hpp +1 -2
- data/ext/zeromq/src/pub.cpp +2 -16
- data/ext/zeromq/src/pub.hpp +2 -19
- data/ext/zeromq/src/pull.cpp +7 -24
- data/ext/zeromq/src/pull.hpp +4 -21
- data/ext/zeromq/src/push.cpp +8 -22
- data/ext/zeromq/src/push.hpp +4 -21
- data/ext/zeromq/src/random.cpp +1 -2
- data/ext/zeromq/src/random.hpp +1 -2
- data/ext/zeromq/src/raw_decoder.cpp +63 -0
- data/ext/zeromq/src/raw_decoder.hpp +66 -0
- data/ext/zeromq/src/raw_encoder.cpp +40 -0
- data/ext/zeromq/src/raw_encoder.hpp +60 -0
- data/ext/zeromq/src/reaper.cpp +12 -2
- data/ext/zeromq/src/reaper.hpp +6 -2
- data/ext/zeromq/src/rep.cpp +7 -21
- data/ext/zeromq/src/rep.hpp +3 -20
- data/ext/zeromq/src/req.cpp +132 -38
- data/ext/zeromq/src/req.hpp +27 -8
- data/ext/zeromq/src/router.cpp +109 -65
- data/ext/zeromq/src/router.hpp +9 -23
- data/ext/zeromq/src/select.cpp +1 -3
- data/ext/zeromq/src/select.hpp +1 -3
- data/ext/zeromq/src/session_base.cpp +164 -118
- data/ext/zeromq/src/session_base.hpp +29 -22
- data/ext/zeromq/src/signaler.cpp +127 -19
- data/ext/zeromq/src/signaler.hpp +20 -3
- data/ext/zeromq/src/socket_base.cpp +167 -134
- data/ext/zeromq/src/socket_base.hpp +18 -20
- data/ext/zeromq/src/stdint.hpp +1 -2
- data/ext/zeromq/src/stream.cpp +257 -0
- data/ext/zeromq/src/stream.hpp +97 -0
- data/ext/zeromq/src/stream_engine.cpp +405 -157
- data/ext/zeromq/src/stream_engine.hpp +72 -23
- data/ext/zeromq/src/sub.cpp +5 -18
- data/ext/zeromq/src/sub.hpp +2 -19
- data/ext/zeromq/src/tcp.cpp +23 -3
- data/ext/zeromq/src/tcp.hpp +7 -3
- data/ext/zeromq/src/tcp_address.cpp +35 -46
- data/ext/zeromq/src/tcp_address.hpp +7 -12
- data/ext/zeromq/src/tcp_connecter.cpp +10 -5
- data/ext/zeromq/src/tcp_connecter.hpp +1 -3
- data/ext/zeromq/src/tcp_listener.cpp +19 -8
- data/ext/zeromq/src/tcp_listener.hpp +1 -3
- data/ext/zeromq/src/thread.cpp +2 -4
- data/ext/zeromq/src/thread.hpp +1 -3
- data/ext/zeromq/src/trie.cpp +122 -125
- data/ext/zeromq/src/trie.hpp +1 -4
- data/ext/zeromq/src/v1_decoder.cpp +77 -91
- data/ext/zeromq/src/v1_decoder.hpp +10 -21
- data/ext/zeromq/src/v1_encoder.cpp +24 -62
- data/ext/zeromq/src/v1_encoder.hpp +7 -18
- data/ext/zeromq/src/v2_decoder.cpp +142 -0
- data/ext/zeromq/src/v2_decoder.hpp +57 -0
- data/ext/zeromq/src/v2_encoder.cpp +67 -0
- data/ext/zeromq/src/{i_msg_source.hpp → v2_encoder.hpp} +20 -15
- data/ext/zeromq/src/{v1_protocol.hpp → v2_protocol.hpp} +7 -11
- data/ext/zeromq/src/windows.hpp +2 -4
- data/ext/zeromq/src/wire.hpp +5 -6
- data/ext/zeromq/src/xpub.cpp +37 -46
- data/ext/zeromq/src/xpub.hpp +7 -23
- data/ext/zeromq/src/xsub.cpp +26 -40
- data/ext/zeromq/src/xsub.hpp +5 -21
- data/ext/zeromq/src/ypipe.hpp +3 -4
- data/ext/zeromq/src/ypipe_base.hpp +44 -0
- data/ext/zeromq/src/ypipe_conflate.hpp +127 -0
- data/ext/zeromq/src/yqueue.hpp +3 -7
- data/ext/zeromq/src/zmq.cpp +76 -96
- data/ext/zeromq/src/zmq_utils.cpp +146 -8
- data/ext/zeromq/tests/Makefile.am +56 -8
- data/ext/zeromq/tests/test_abstract_ipc.cpp +57 -0
- data/ext/zeromq/tests/test_conflate.cpp +75 -0
- data/ext/zeromq/tests/test_connect_resolve.cpp +14 -15
- data/ext/zeromq/tests/test_ctx_destroy.cpp +90 -0
- data/ext/zeromq/tests/test_ctx_options.cpp +52 -0
- data/ext/zeromq/tests/test_disconnect_inproc.cpp +35 -30
- data/ext/zeromq/tests/test_fork.cpp +81 -0
- data/ext/zeromq/tests/test_hwm.cpp +251 -35
- data/ext/zeromq/tests/test_immediate.cpp +229 -0
- data/ext/zeromq/tests/test_inproc_connect.cpp +339 -0
- data/ext/zeromq/tests/test_invalid_rep.cpp +9 -13
- data/ext/zeromq/tests/test_iov.cpp +106 -0
- data/ext/zeromq/tests/test_issue_566.cpp +85 -0
- data/ext/zeromq/tests/test_last_endpoint.cpp +14 -18
- data/ext/zeromq/tests/test_linger.cpp +93 -0
- data/ext/zeromq/tests/test_monitor.cpp +112 -129
- data/ext/zeromq/tests/test_msg_flags.cpp +17 -16
- data/ext/zeromq/tests/test_pair_inproc.cpp +25 -7
- data/ext/zeromq/tests/test_pair_ipc.cpp +4 -7
- data/ext/zeromq/tests/test_pair_tcp.cpp +4 -8
- data/ext/zeromq/tests/test_probe_router.cpp +72 -0
- data/ext/zeromq/tests/test_req_correlate.cpp +177 -0
- data/ext/zeromq/tests/test_req_relaxed.cpp +116 -0
- data/ext/zeromq/tests/test_reqrep_device.cpp +9 -17
- data/ext/zeromq/tests/test_reqrep_inproc.cpp +4 -7
- data/ext/zeromq/tests/test_reqrep_ipc.cpp +4 -7
- data/ext/zeromq/tests/test_reqrep_tcp.cpp +4 -8
- data/ext/zeromq/tests/test_router_mandatory.cpp +41 -22
- data/ext/zeromq/tests/test_security_curve.cpp +212 -0
- data/ext/zeromq/tests/test_security_null.cpp +148 -0
- data/ext/zeromq/tests/test_security_plain.cpp +150 -0
- data/ext/zeromq/tests/test_shutdown_stress.cpp +10 -23
- data/ext/zeromq/tests/test_spec_dealer.cpp +254 -0
- data/ext/zeromq/tests/test_spec_pushpull.cpp +293 -0
- data/ext/zeromq/tests/test_spec_rep.cpp +155 -0
- data/ext/zeromq/tests/test_spec_req.cpp +253 -0
- data/ext/zeromq/tests/test_spec_router.cpp +204 -0
- data/ext/zeromq/tests/test_stream.cpp +228 -0
- data/ext/zeromq/tests/test_sub_forward.cpp +14 -22
- data/ext/zeromq/tests/test_system.cpp +82 -0
- data/ext/zeromq/tests/test_term_endpoint.cpp +17 -31
- data/ext/zeromq/tests/test_timeo.cpp +34 -78
- data/ext/zeromq/tests/testutil.hpp +211 -26
- data/ext/zeromq/tools/Makefile.am +9 -0
- data/ext/zeromq/tools/curve_keygen.c +58 -0
- data/lib/zmq/version.rb +1 -1
- data/test/test_socket.rb +4 -3
- metadata +114 -15
- data/ext/zeromq/cmake/Modules/TestZMQVersion.cmake +0 -35
- data/ext/zeromq/foreign/openpgm/libpgm-5.1.118~dfsg.tar.gz +0 -0
- data/ext/zeromq/src/decoder.cpp +0 -166
- data/ext/zeromq/src/encoder.cpp +0 -102
- data/ext/zeromq/tests/test_connect_delay.cpp +0 -260
@@ -0,0 +1,44 @@
|
|
1
|
+
// The Strawhouse Pattern
|
2
|
+
//
|
3
|
+
// We allow or deny clients according to their IP address. It may keep
|
4
|
+
// spammers and idiots away, but won't stop a real attacker for more
|
5
|
+
// than a heartbeat.
|
6
|
+
|
7
|
+
#include <czmq.h>
|
8
|
+
|
9
|
+
int main (void)
|
10
|
+
{
|
11
|
+
// Create context
|
12
|
+
zctx_t *ctx = zctx_new ();
|
13
|
+
|
14
|
+
// Start an authentication engine for this context. This engine
|
15
|
+
// allows or denies incoming connections (talking to the libzmq
|
16
|
+
// core over a protocol called ZAP).
|
17
|
+
zauth_t *auth = zauth_new (ctx);
|
18
|
+
|
19
|
+
// Get some indication of what the authenticator is deciding
|
20
|
+
zauth_set_verbose (auth, true);
|
21
|
+
|
22
|
+
// Whitelist our address; any other address will be rejected
|
23
|
+
zauth_allow (auth, "127.0.0.1");
|
24
|
+
|
25
|
+
// Create and bind server socket
|
26
|
+
void *server = zsocket_new (ctx, ZMQ_PUSH);
|
27
|
+
zsocket_set_zap_domain (server, "global");
|
28
|
+
zsocket_bind (server, "tcp://*:9000");
|
29
|
+
|
30
|
+
// Create and connect client socket
|
31
|
+
void *client = zsocket_new (ctx, ZMQ_PULL);
|
32
|
+
zsocket_connect (client, "tcp://127.0.0.1:9000");
|
33
|
+
|
34
|
+
// Send a single message from server to client
|
35
|
+
zstr_send (server, "Hello");
|
36
|
+
char *message = zstr_recv (client);
|
37
|
+
assert (streq (message, "Hello"));
|
38
|
+
free (message);
|
39
|
+
puts ("Strawhouse test OK");
|
40
|
+
|
41
|
+
zauth_destroy (&auth);
|
42
|
+
zctx_destroy (&ctx);
|
43
|
+
return 0;
|
44
|
+
}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
// The Woodhouse Pattern
|
2
|
+
//
|
3
|
+
// It may keep some malicious people out but all it takes is a bit
|
4
|
+
// of network sniffing, and they'll be able to fake their way in.
|
5
|
+
|
6
|
+
#include <czmq.h>
|
7
|
+
|
8
|
+
int main (void)
|
9
|
+
{
|
10
|
+
// Create context and start authentication engine
|
11
|
+
zctx_t *ctx = zctx_new ();
|
12
|
+
zauth_t *auth = zauth_new (ctx);
|
13
|
+
zauth_set_verbose (auth, true);
|
14
|
+
zauth_allow (auth, "127.0.0.1");
|
15
|
+
|
16
|
+
// Tell the authenticator how to handle PLAIN requests
|
17
|
+
zauth_configure_plain (auth, "*", "passwords");
|
18
|
+
|
19
|
+
// Create and bind server socket
|
20
|
+
void *server = zsocket_new (ctx, ZMQ_PUSH);
|
21
|
+
zsocket_set_plain_server (server, 1);
|
22
|
+
zsocket_bind (server, "tcp://*:9000");
|
23
|
+
|
24
|
+
// Create and connect client socket
|
25
|
+
void *client = zsocket_new (ctx, ZMQ_PULL);
|
26
|
+
zsocket_set_plain_username (client, "admin");
|
27
|
+
zsocket_set_plain_password (client, "secret");
|
28
|
+
zsocket_connect (client, "tcp://127.0.0.1:9000");
|
29
|
+
|
30
|
+
// Send a single message from server to client
|
31
|
+
zstr_send (server, "Hello");
|
32
|
+
char *message = zstr_recv (client);
|
33
|
+
assert (streq (message, "Hello"));
|
34
|
+
free (message);
|
35
|
+
puts ("Woodhouse test OK");
|
36
|
+
|
37
|
+
zauth_destroy (&auth);
|
38
|
+
zctx_destroy (&ctx);
|
39
|
+
return 0;
|
40
|
+
}
|
Binary file
|
Binary file
|
data/ext/czmq/include/czmq.h
CHANGED
@@ -32,9 +32,9 @@
|
|
32
32
|
|
33
33
|
// CZMQ version macros for compile-time API detection
|
34
34
|
|
35
|
-
#define CZMQ_VERSION_MAJOR
|
36
|
-
#define CZMQ_VERSION_MINOR
|
37
|
-
#define CZMQ_VERSION_PATCH
|
35
|
+
#define CZMQ_VERSION_MAJOR 2
|
36
|
+
#define CZMQ_VERSION_MINOR 0
|
37
|
+
#define CZMQ_VERSION_PATCH 1
|
38
38
|
|
39
39
|
#define CZMQ_MAKE_VERSION(major, minor, patch) \
|
40
40
|
((major) * 10000 + (minor) * 100 + (patch))
|
@@ -43,22 +43,28 @@
|
|
43
43
|
|
44
44
|
// Classes in the API
|
45
45
|
|
46
|
+
#include "zchunk.h"
|
46
47
|
#include "zclock.h"
|
47
48
|
#include "zconfig.h"
|
48
49
|
#include "zctx.h"
|
49
50
|
#include "zfile.h"
|
51
|
+
#include "zdir.h"
|
50
52
|
#include "zframe.h"
|
51
53
|
#include "zlist.h"
|
52
54
|
#include "zhash.h"
|
53
|
-
#include "ztree.h"
|
54
55
|
#include "zloop.h"
|
55
56
|
#include "zmsg.h"
|
56
57
|
#include "zmutex.h"
|
58
|
+
#include "zpoller.h"
|
57
59
|
#include "zsocket.h"
|
58
60
|
#include "zsockopt.h"
|
59
61
|
#include "zstr.h"
|
60
62
|
#include "zsys.h"
|
61
63
|
#include "zthread.h"
|
64
|
+
#include "ztree.h"
|
62
65
|
#include "zbeacon.h"
|
66
|
+
#include "zauth.h"
|
67
|
+
#include "zcert.h"
|
68
|
+
#include "zcertstore.h"
|
63
69
|
|
64
70
|
#endif
|
@@ -88,10 +88,9 @@
|
|
88
88
|
# define __WINDOWS__
|
89
89
|
# undef __MSDOS__
|
90
90
|
# define __MSDOS__
|
91
|
-
|
92
|
-
#
|
93
|
-
#
|
94
|
-
# endif
|
91
|
+
// Stop cheeky warnings about "deprecated" functions like fopen
|
92
|
+
# if _MSC_VER >= 1500
|
93
|
+
# define _CRT_SECURE_NO_DEPRECATE
|
95
94
|
# pragma warning(disable: 4996)
|
96
95
|
# endif
|
97
96
|
#endif
|
@@ -248,12 +247,6 @@
|
|
248
247
|
# include <sys/stat.h>
|
249
248
|
# include <sys/utime.h>
|
250
249
|
# include <share.h>
|
251
|
-
# if _MSC_VER == 1500
|
252
|
-
# ifndef _CRT_SECURE_NO_DEPRECATE
|
253
|
-
# define _CRT_SECURE_NO_DEPRECATE 1
|
254
|
-
# endif
|
255
|
-
# pragma warning(disable: 4996)
|
256
|
-
# endif
|
257
250
|
#endif
|
258
251
|
|
259
252
|
#if (defined (__UNIX__))
|
@@ -274,9 +267,10 @@
|
|
274
267
|
# include <sys/ioctl.h>
|
275
268
|
# include <sys/file.h>
|
276
269
|
# include <sys/wait.h>
|
277
|
-
# include <sys/uio.h>
|
278
|
-
# include <netinet/in.h>
|
279
|
-
# if (!defined (__UTYPE_ANDROID)) && (!defined (__UTYPE_IBMAIX))
|
270
|
+
# include <sys/uio.h> // Let CZMQ build with libzmq/3.x
|
271
|
+
# include <netinet/in.h> // Must come before arpa/inet.h
|
272
|
+
# if (!defined (__UTYPE_ANDROID)) && (!defined (__UTYPE_IBMAIX)) \
|
273
|
+
&& (!defined (__UTYPE_HPUX)) && (!defined (__UTYPE_SUNOS))
|
280
274
|
# include <ifaddrs.h>
|
281
275
|
# endif
|
282
276
|
# if (!defined (__UTYPE_BEOS))
|
@@ -291,12 +285,12 @@
|
|
291
285
|
# if (defined (__UTYPE_BEOS))
|
292
286
|
# include <NetKit.h>
|
293
287
|
# endif
|
294
|
-
# if ((defined (_XOPEN_REALTIME) && (_XOPEN_REALTIME >= 1))
|
295
|
-
|
288
|
+
# if ((defined (_XOPEN_REALTIME) && (_XOPEN_REALTIME >= 1)) \
|
289
|
+
|| (defined (_POSIX_VERSION) && (_POSIX_VERSION >= 199309L)))
|
296
290
|
# include <sched.h>
|
297
291
|
# endif
|
298
292
|
# if (defined (__UTYPE_OSX))
|
299
|
-
# include <crt_externs.h>
|
293
|
+
# include <crt_externs.h> // For _NSGetEnviron()
|
300
294
|
# endif
|
301
295
|
#endif
|
302
296
|
|
@@ -372,7 +366,8 @@ typedef unsigned int qbyte; // Quad byte = 32 bits
|
|
372
366
|
#define strneq(s1,s2) (strcmp ((s1), (s2)))
|
373
367
|
|
374
368
|
// Provide random number from 0..(num-1)
|
375
|
-
#if (defined (__WINDOWS__)) || (defined (__UTYPE_IBMAIX))
|
369
|
+
#if (defined (__WINDOWS__)) || (defined (__UTYPE_IBMAIX)) \
|
370
|
+
|| (defined (__UTYPE_HPUX)) || (defined (__UTYPE_SUNOS))
|
376
371
|
# define randof(num) (int) ((float) (num) * rand () / (RAND_MAX + 1.0))
|
377
372
|
#else
|
378
373
|
# define randof(num) (int) ((float) (num) * random () / (RAND_MAX + 1.0))
|
@@ -380,11 +375,11 @@ typedef unsigned int qbyte; // Quad byte = 32 bits
|
|
380
375
|
|
381
376
|
// Windows MSVS doesn't have stdbool
|
382
377
|
#if (defined (__WINDOWS__))
|
383
|
-
#
|
384
|
-
#
|
385
|
-
#
|
386
|
-
|
387
|
-
#
|
378
|
+
# if (!defined (__cplusplus) && (!defined (true)))
|
379
|
+
# define true 1
|
380
|
+
# define false 0
|
381
|
+
typedef char bool;
|
382
|
+
# endif
|
388
383
|
#else
|
389
384
|
# include <stdbool.h>
|
390
385
|
#endif
|
@@ -392,7 +387,9 @@ typedef unsigned int qbyte; // Quad byte = 32 bits
|
|
392
387
|
//- A number of POSIX and C99 keywords and data types -----------------------
|
393
388
|
|
394
389
|
#if (defined (__WINDOWS__))
|
395
|
-
#
|
390
|
+
# if (!defined (__cplusplus) && (!defined (inline)))
|
391
|
+
# define inline __inline
|
392
|
+
# endif
|
396
393
|
# define strtoull _strtoui64
|
397
394
|
# define srandom srand
|
398
395
|
# define TIMEZONE _timezone
|
@@ -475,30 +472,33 @@ static inline void *
|
|
475
472
|
|
476
473
|
#include "zmq.h"
|
477
474
|
|
478
|
-
|
475
|
+
#if ZMQ_VERSION_MAJOR == 4
|
476
|
+
# define ZMQ_POLL_MSEC 1 // zmq_poll is msec
|
479
477
|
|
480
|
-
#
|
481
|
-
# define
|
482
|
-
|
483
|
-
#
|
484
|
-
# define
|
485
|
-
#
|
486
|
-
#
|
487
|
-
|
488
|
-
#
|
489
|
-
#
|
490
|
-
#
|
491
|
-
#
|
492
|
-
#
|
478
|
+
#elif ZMQ_VERSION_MAJOR == 3
|
479
|
+
# define ZMQ_POLL_MSEC 1 // zmq_poll is msec
|
480
|
+
|
481
|
+
#elif ZMQ_VERSION_MAJOR == 2
|
482
|
+
# define ZMQ_POLL_MSEC 1000 // zmq_poll is usec
|
483
|
+
# define zmq_sendmsg zmq_send // Smooth out 2.x changes
|
484
|
+
# define zmq_recvmsg zmq_recv
|
485
|
+
// Older libzmq APIs may be missing some aspects of libzmq v3.0
|
486
|
+
# ifndef ZMQ_ROUTER
|
487
|
+
# define ZMQ_ROUTER ZMQ_XREP
|
488
|
+
# endif
|
489
|
+
# ifndef ZMQ_DEALER
|
490
|
+
# define ZMQ_DEALER ZMQ_XREQ
|
491
|
+
# endif
|
492
|
+
# ifndef ZMQ_DONTWAIT
|
493
|
+
# define ZMQ_DONTWAIT ZMQ_NOBLOCK
|
494
|
+
# endif
|
495
|
+
# ifndef ZMQ_XSUB
|
496
|
+
# error "please upgrade your libzmq from http://zeromq.org"
|
497
|
+
# endif
|
493
498
|
# if ZMQ_VERSION_MINOR == 0 \
|
494
499
|
|| (ZMQ_VERSION_MINOR == 1 && ZMQ_VERSION_PATCH < 7)
|
495
500
|
# error "CZMQ requires at least libzmq/2.1.7 stable"
|
496
501
|
# endif
|
497
|
-
# define zmq_sendmsg zmq_send
|
498
|
-
# define zmq_recvmsg zmq_recv
|
499
|
-
# define ZMQ_POLL_MSEC 1000 // zmq_poll is usec
|
500
|
-
#elif ZMQ_VERSION_MAJOR == 3 || ZMQ_VERSION_MAJOR == 4
|
501
|
-
# define ZMQ_POLL_MSEC 1 // zmq_poll is msec
|
502
502
|
#endif
|
503
503
|
|
504
504
|
#endif
|
@@ -0,0 +1,97 @@
|
|
1
|
+
/* =========================================================================
|
2
|
+
zauth - authentication for ZeroMQ security mechanisms
|
3
|
+
|
4
|
+
-------------------------------------------------------------------------
|
5
|
+
Copyright (c) 1991-2013 iMatix Corporation <www.imatix.com>
|
6
|
+
Copyright other contributors as noted in the AUTHORS file.
|
7
|
+
|
8
|
+
This file is part of CZMQ, the high-level C binding for 0MQ:
|
9
|
+
http://czmq.zeromq.org.
|
10
|
+
|
11
|
+
This is free software; you can redistribute it and/or modify it under
|
12
|
+
the terms of the GNU Lesser General Public License as published by the
|
13
|
+
Free Software Foundation; either version 3 of the License, or (at your
|
14
|
+
option) any later version.
|
15
|
+
|
16
|
+
This software is distributed in the hope that it will be useful, but
|
17
|
+
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABIL-
|
18
|
+
ITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
|
19
|
+
Public License for more details.
|
20
|
+
|
21
|
+
You should have received a copy of the GNU Lesser General Public License
|
22
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
23
|
+
=========================================================================
|
24
|
+
*/
|
25
|
+
|
26
|
+
#ifndef __ZAUTH_H_INCLUDED__
|
27
|
+
#define __ZAUTH_H_INCLUDED__
|
28
|
+
|
29
|
+
#ifdef __cplusplus
|
30
|
+
extern "C" {
|
31
|
+
#endif
|
32
|
+
|
33
|
+
// Opaque class structure
|
34
|
+
typedef struct _zauth_t zauth_t;
|
35
|
+
|
36
|
+
// @interface
|
37
|
+
#define CURVE_ALLOW_ANY "*"
|
38
|
+
|
39
|
+
// Constructor
|
40
|
+
// Install authentication for the specified context. Returns a new zauth
|
41
|
+
// object that you can use to configure authentication. Note that until you
|
42
|
+
// add policies, all incoming NULL connections are allowed (classic ZeroMQ
|
43
|
+
// behaviour), and all PLAIN and CURVE connections are denied. If there was
|
44
|
+
// an error during initialization, returns NULL.
|
45
|
+
CZMQ_EXPORT zauth_t *
|
46
|
+
zauth_new (zctx_t *ctx);
|
47
|
+
|
48
|
+
// Allow (whitelist) a single IP address. For NULL, all clients from this
|
49
|
+
// address will be accepted. For PLAIN and CURVE, they will be allowed to
|
50
|
+
// continue with authentication. You can call this method multiple times
|
51
|
+
// to whitelist multiple IP addresses. If you whitelist a single address,
|
52
|
+
// any non-whitelisted addresses are treated as blacklisted.
|
53
|
+
CZMQ_EXPORT void
|
54
|
+
zauth_allow (zauth_t *self, char *address);
|
55
|
+
|
56
|
+
// Deny (blacklist) a single IP address. For all security mechanisms, this
|
57
|
+
// rejects the connection without any further authentication. Use either a
|
58
|
+
// whitelist, or a blacklist, not not both. If you define both a whitelist
|
59
|
+
// and a blacklist, only the whitelist takes effect.
|
60
|
+
CZMQ_EXPORT void
|
61
|
+
zauth_deny (zauth_t *self, char *address);
|
62
|
+
|
63
|
+
// Configure PLAIN authentication for a given domain. PLAIN authentication
|
64
|
+
// uses a plain-text password file. The filename is treated as a printf
|
65
|
+
// format. To cover all domains, use "*". You can modify the password file
|
66
|
+
// at any time; it is reloaded automatically.
|
67
|
+
CZMQ_EXPORT void
|
68
|
+
zauth_configure_plain (zauth_t *self, char *domain, char *filename, ...);
|
69
|
+
|
70
|
+
// Configure CURVE authentication for a given domain. CURVE authentication
|
71
|
+
// uses a directory that holds all public client certificates, i.e. their
|
72
|
+
// public keys. The certificates must be in zcert_save () format. The
|
73
|
+
// location is treated as a printf format. To cover all domains, use "*".
|
74
|
+
// You can add and remove certificates in that directory at any time.
|
75
|
+
// To allow all client keys without checking, specify CURVE_ALLOW_ANY
|
76
|
+
// for the location.
|
77
|
+
CZMQ_EXPORT void
|
78
|
+
zauth_configure_curve (zauth_t *self, char *domain, char *location, ...);
|
79
|
+
|
80
|
+
// Enable verbose tracing of commands and activity
|
81
|
+
CZMQ_EXPORT void
|
82
|
+
zauth_set_verbose (zauth_t *self, bool verbose);
|
83
|
+
|
84
|
+
// Destructor
|
85
|
+
CZMQ_EXPORT void
|
86
|
+
zauth_destroy (zauth_t **self_p);
|
87
|
+
|
88
|
+
// Selftest
|
89
|
+
CZMQ_EXPORT int
|
90
|
+
zauth_test (bool verbose);
|
91
|
+
// @end
|
92
|
+
|
93
|
+
#ifdef __cplusplus
|
94
|
+
}
|
95
|
+
#endif
|
96
|
+
|
97
|
+
#endif
|
data/ext/czmq/include/zbeacon.h
CHANGED
@@ -74,11 +74,6 @@ CZMQ_EXPORT void
|
|
74
74
|
CZMQ_EXPORT void *
|
75
75
|
zbeacon_socket (zbeacon_t *self);
|
76
76
|
|
77
|
-
// Get beacon pipe, for polling or receiving messages
|
78
|
-
// DEPRECATED
|
79
|
-
CZMQ_EXPORT void *
|
80
|
-
zbeacon_pipe (zbeacon_t *self);
|
81
|
-
|
82
77
|
// Self test of this class
|
83
78
|
CZMQ_EXPORT void
|
84
79
|
zbeacon_test (bool verbose);
|
@@ -0,0 +1,118 @@
|
|
1
|
+
/* =========================================================================
|
2
|
+
zcert - work with CURVE security certificates
|
3
|
+
|
4
|
+
-------------------------------------------------------------------------
|
5
|
+
Copyright (c) 1991-2013 iMatix Corporation <www.imatix.com>
|
6
|
+
Copyright other contributors as noted in the AUTHORS file.
|
7
|
+
|
8
|
+
This file is part of CZMQ, the high-level C binding for 0MQ:
|
9
|
+
http://czmq.zeromq.org.
|
10
|
+
|
11
|
+
This is free software; you can redistribute it and/or modify it under
|
12
|
+
the terms of the GNU Lesser General Public License as published by the
|
13
|
+
Free Software Foundation; either version 3 of the License, or (at your
|
14
|
+
option) any later version.
|
15
|
+
|
16
|
+
This software is distributed in the hope that it will be useful, but
|
17
|
+
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABIL-
|
18
|
+
ITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
|
19
|
+
Public License for more details.
|
20
|
+
|
21
|
+
You should have received a copy of the GNU Lesser General Public License
|
22
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
23
|
+
=========================================================================
|
24
|
+
*/
|
25
|
+
|
26
|
+
#ifndef __ZCERT_H_INCLUDED__
|
27
|
+
#define __ZCERT_H_INCLUDED__
|
28
|
+
|
29
|
+
#ifdef __cplusplus
|
30
|
+
extern "C" {
|
31
|
+
#endif
|
32
|
+
|
33
|
+
// Opaque class structure
|
34
|
+
typedef struct _zcert_t zcert_t;
|
35
|
+
|
36
|
+
// @interface
|
37
|
+
|
38
|
+
// Create and initialize a new certificate in memory
|
39
|
+
CZMQ_EXPORT zcert_t *
|
40
|
+
zcert_new (void);
|
41
|
+
|
42
|
+
// Constructor, accepts public/secret key pair from caller
|
43
|
+
CZMQ_EXPORT zcert_t *
|
44
|
+
zcert_new_from (byte *public_key, byte *secret_key);
|
45
|
+
|
46
|
+
// Destroy a certificate in memory
|
47
|
+
CZMQ_EXPORT void
|
48
|
+
zcert_destroy (zcert_t **self_p);
|
49
|
+
|
50
|
+
// Return public part of key pair as 32-byte binary string
|
51
|
+
CZMQ_EXPORT byte *
|
52
|
+
zcert_public_key (zcert_t *self);
|
53
|
+
|
54
|
+
// Return secret part of key pair as 32-byte binary string
|
55
|
+
CZMQ_EXPORT byte *
|
56
|
+
zcert_secret_key (zcert_t *self);
|
57
|
+
|
58
|
+
// Return public part of key pair as Z85 armored string
|
59
|
+
CZMQ_EXPORT char *
|
60
|
+
zcert_public_txt (zcert_t *self);
|
61
|
+
|
62
|
+
// Return secret part of key pair as Z85 armored string
|
63
|
+
CZMQ_EXPORT char *
|
64
|
+
zcert_secret_txt (zcert_t *self);
|
65
|
+
|
66
|
+
// Set certificate metadata from formatted string.
|
67
|
+
CZMQ_EXPORT void
|
68
|
+
zcert_set_meta (zcert_t *self, char *name, char *format, ...);
|
69
|
+
|
70
|
+
// Get metadata value from certificate; if the metadata value doesn't
|
71
|
+
// exist, returns NULL.
|
72
|
+
CZMQ_EXPORT char *
|
73
|
+
zcert_meta (zcert_t *self, char *name);
|
74
|
+
|
75
|
+
// Load certificate from file (constructor)
|
76
|
+
// The filename is treated as a printf format specifier.
|
77
|
+
CZMQ_EXPORT zcert_t *
|
78
|
+
zcert_load (char *filename, ...);
|
79
|
+
|
80
|
+
// Save full certificate (public + secret) to file for persistent storage
|
81
|
+
// This creates one public file and one secret file (filename + "_secret").
|
82
|
+
// The filename is treated as a printf format specifier.
|
83
|
+
CZMQ_EXPORT int
|
84
|
+
zcert_save (zcert_t *self, char *filename, ...);
|
85
|
+
|
86
|
+
// Save public certificate only to file for persistent storage
|
87
|
+
// The filename is treated as a printf format specifier.
|
88
|
+
CZMQ_EXPORT int
|
89
|
+
zcert_save_public (zcert_t *self, char *filename, ...);
|
90
|
+
|
91
|
+
// Apply certificate to socket, i.e. use for CURVE security on socket.
|
92
|
+
// If certificate was loaded from public file, the secret key will be
|
93
|
+
// undefined, and this certificate will not work successfully.
|
94
|
+
CZMQ_EXPORT void
|
95
|
+
zcert_apply (zcert_t *self, void *zocket);
|
96
|
+
|
97
|
+
// Return copy of certificate
|
98
|
+
CZMQ_EXPORT zcert_t *
|
99
|
+
zcert_dup (zcert_t *self);
|
100
|
+
|
101
|
+
// Return true if two certificates have the same keys
|
102
|
+
CZMQ_EXPORT bool
|
103
|
+
zcert_eq (zcert_t *self, zcert_t *compare);
|
104
|
+
|
105
|
+
// Dump certificate contents to stderr for debugging
|
106
|
+
CZMQ_EXPORT void
|
107
|
+
zcert_dump (zcert_t *self);
|
108
|
+
|
109
|
+
// Self test of this class
|
110
|
+
CZMQ_EXPORT int
|
111
|
+
zcert_test (bool verbose);
|
112
|
+
// @end
|
113
|
+
|
114
|
+
#ifdef __cplusplus
|
115
|
+
}
|
116
|
+
#endif
|
117
|
+
|
118
|
+
#endif
|