czmq-ffi-gen 0.9.2-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/AUTHORS +1 -0
- data/CHANGES.md +92 -0
- data/Gemfile +2 -0
- data/LICENSE +14 -0
- data/README.md +112 -0
- data/lib/czmq-ffi-gen.rb +7 -0
- data/lib/czmq-ffi-gen/czmq/ffi.rb +1210 -0
- data/lib/czmq-ffi-gen/czmq/ffi/version.rb +15 -0
- data/lib/czmq-ffi-gen/czmq/ffi/zactor.rb +186 -0
- data/lib/czmq-ffi-gen/czmq/ffi/zarmour.rb +286 -0
- data/lib/czmq-ffi-gen/czmq/ffi/zcert.rb +307 -0
- data/lib/czmq-ffi-gen/czmq/ffi/zcertstore.rb +222 -0
- data/lib/czmq-ffi-gen/czmq/ffi/zchunk.rb +388 -0
- data/lib/czmq-ffi-gen/czmq/ffi/zclock.rb +140 -0
- data/lib/czmq-ffi-gen/czmq/ffi/zconfig.rb +442 -0
- data/lib/czmq-ffi-gen/czmq/ffi/zdigest.rb +156 -0
- data/lib/czmq-ffi-gen/czmq/ffi/zdir.rb +283 -0
- data/lib/czmq-ffi-gen/czmq/ffi/zdir_patch.rb +194 -0
- data/lib/czmq-ffi-gen/czmq/ffi/zfile.rb +353 -0
- data/lib/czmq-ffi-gen/czmq/ffi/zframe.rb +359 -0
- data/lib/czmq-ffi-gen/czmq/ffi/zhash.rb +416 -0
- data/lib/czmq-ffi-gen/czmq/ffi/zhashx.rb +659 -0
- data/lib/czmq-ffi-gen/czmq/ffi/ziflist.rb +189 -0
- data/lib/czmq-ffi-gen/czmq/ffi/zlist.rb +365 -0
- data/lib/czmq-ffi-gen/czmq/ffi/zlistx.rb +478 -0
- data/lib/czmq-ffi-gen/czmq/ffi/zloop.rb +396 -0
- data/lib/czmq-ffi-gen/czmq/ffi/zmsg.rb +515 -0
- data/lib/czmq-ffi-gen/czmq/ffi/zpoller.rb +194 -0
- data/lib/czmq-ffi-gen/czmq/ffi/zproc.rb +294 -0
- data/lib/czmq-ffi-gen/czmq/ffi/zsock.rb +3479 -0
- data/lib/czmq-ffi-gen/czmq/ffi/zstr.rb +203 -0
- data/lib/czmq-ffi-gen/czmq/ffi/ztimerset.rb +203 -0
- data/lib/czmq-ffi-gen/czmq/ffi/ztrie.rb +221 -0
- data/lib/czmq-ffi-gen/czmq/ffi/zuuid.rb +227 -0
- data/lib/czmq-ffi-gen/errors.rb +12 -0
- data/lib/czmq-ffi-gen/gem_version.rb +5 -0
- data/lib/czmq-ffi-gen/legacy.rb +16 -0
- data/lib/czmq-ffi-gen/libzmq.rb +18 -0
- data/lib/czmq-ffi-gen/signals.rb +27 -0
- data/lib/czmq-ffi-gen/vendor.rb +5 -0
- data/lib/czmq-ffi-gen/versions.rb +19 -0
- data/vendor/local/bin/inproc_lat.exe +0 -0
- data/vendor/local/bin/inproc_thr.exe +0 -0
- data/vendor/local/bin/libczmq.dll +0 -0
- data/vendor/local/bin/libgcc_s_seh-1.dll +0 -0
- data/vendor/local/bin/libstdc++-6.dll +0 -0
- data/vendor/local/bin/libzmq.dll +0 -0
- data/vendor/local/bin/local_lat.exe +0 -0
- data/vendor/local/bin/local_thr.exe +0 -0
- data/vendor/local/bin/remote_lat.exe +0 -0
- data/vendor/local/bin/remote_thr.exe +0 -0
- data/vendor/local/include/czmq.h +31 -0
- data/vendor/local/include/czmq_library.h +199 -0
- data/vendor/local/include/czmq_prelude.h +641 -0
- data/vendor/local/include/readme.txt +83 -0
- data/vendor/local/include/sha1.h +76 -0
- data/vendor/local/include/sha1.inc_c +335 -0
- data/vendor/local/include/slre.h +92 -0
- data/vendor/local/include/slre.inc_c +660 -0
- data/vendor/local/include/zactor.h +76 -0
- data/vendor/local/include/zarmour.h +114 -0
- data/vendor/local/include/zauth.h +100 -0
- data/vendor/local/include/zauth_v2.h +88 -0
- data/vendor/local/include/zbeacon.h +86 -0
- data/vendor/local/include/zbeacon_v2.h +75 -0
- data/vendor/local/include/zcert.h +136 -0
- data/vendor/local/include/zcertstore.h +100 -0
- data/vendor/local/include/zchunk.h +163 -0
- data/vendor/local/include/zclock.h +73 -0
- data/vendor/local/include/zconfig.h +185 -0
- data/vendor/local/include/zctx.h +107 -0
- data/vendor/local/include/zdigest.h +65 -0
- data/vendor/local/include/zdir.h +149 -0
- data/vendor/local/include/zdir_patch.h +82 -0
- data/vendor/local/include/zfile.h +177 -0
- data/vendor/local/include/zframe.h +176 -0
- data/vendor/local/include/zgossip.h +95 -0
- data/vendor/local/include/zgossip_engine.inc +927 -0
- data/vendor/local/include/zgossip_msg.h +129 -0
- data/vendor/local/include/zhash.h +195 -0
- data/vendor/local/include/zhash_primes.inc +329 -0
- data/vendor/local/include/zhashx.h +298 -0
- data/vendor/local/include/ziflist.h +77 -0
- data/vendor/local/include/zlist.h +158 -0
- data/vendor/local/include/zlistx.h +205 -0
- data/vendor/local/include/zloop.h +168 -0
- data/vendor/local/include/zmonitor.h +73 -0
- data/vendor/local/include/zmonitor_v2.h +56 -0
- data/vendor/local/include/zmq.h +617 -0
- data/vendor/local/include/zmq_utils.h +48 -0
- data/vendor/local/include/zmsg.h +280 -0
- data/vendor/local/include/zmutex.h +55 -0
- data/vendor/local/include/zpoller.h +92 -0
- data/vendor/local/include/zproc.h +168 -0
- data/vendor/local/include/zproxy.h +111 -0
- data/vendor/local/include/zproxy_v2.h +62 -0
- data/vendor/local/include/zrex.h +82 -0
- data/vendor/local/include/zsock.h +912 -0
- data/vendor/local/include/zsock_option.inc +4126 -0
- data/vendor/local/include/zsocket.h +110 -0
- data/vendor/local/include/zsockopt.h +256 -0
- data/vendor/local/include/zstr.h +110 -0
- data/vendor/local/include/zsys.h +386 -0
- data/vendor/local/include/zthread.h +50 -0
- data/vendor/local/include/ztimerset.h +90 -0
- data/vendor/local/include/ztrie.h +106 -0
- data/vendor/local/include/zuuid.h +96 -0
- data/vendor/local/lib/libczmq.dll.a +0 -0
- data/vendor/local/lib/liblibzmq.dll.a +0 -0
- data/vendor/local/lib/libzmq-static.a +0 -0
- data/vendor/local/lib/pkgconfig/libczmq.pc +23 -0
- data/vendor/local/lib/pkgconfig/libzmq.pc +11 -0
- data/vendor/local/share/zmq/AUTHORS.txt +147 -0
- data/vendor/local/share/zmq/COPYING.LESSER.txt +181 -0
- data/vendor/local/share/zmq/COPYING.txt +674 -0
- data/vendor/local/share/zmq/NEWS.txt +978 -0
- metadata +230 -0
@@ -0,0 +1,76 @@
|
|
1
|
+
/* =========================================================================
|
2
|
+
zactor - actor
|
3
|
+
|
4
|
+
Copyright (c) the Contributors as noted in the AUTHORS file.
|
5
|
+
This file is part of CZMQ, the high-level C binding for 0MQ:
|
6
|
+
http://czmq.zeromq.org.
|
7
|
+
|
8
|
+
This Source Code Form is subject to the terms of the Mozilla Public
|
9
|
+
License, v. 2.0. If a copy of the MPL was not distributed with this
|
10
|
+
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
11
|
+
=========================================================================
|
12
|
+
*/
|
13
|
+
|
14
|
+
#ifndef __ZACTOR_H_INCLUDED__
|
15
|
+
#define __ZACTOR_H_INCLUDED__
|
16
|
+
|
17
|
+
#ifdef __cplusplus
|
18
|
+
extern "C" {
|
19
|
+
#endif
|
20
|
+
|
21
|
+
// @warning THE FOLLOWING @INTERFACE BLOCK IS AUTO-GENERATED BY ZPROJECT
|
22
|
+
// @warning Please edit the model at "api/zactor.api" to make changes.
|
23
|
+
// @interface
|
24
|
+
// This is a stable class, and may not change except for emergencies. It
|
25
|
+
// is provided in stable builds.
|
26
|
+
// Actors get a pipe and arguments from caller
|
27
|
+
typedef void (zactor_fn) (
|
28
|
+
zsock_t *pipe, void *args);
|
29
|
+
|
30
|
+
// Create a new actor passing arbitrary arguments reference.
|
31
|
+
CZMQ_EXPORT zactor_t *
|
32
|
+
zactor_new (zactor_fn task, void *args);
|
33
|
+
|
34
|
+
// Destroy an actor.
|
35
|
+
CZMQ_EXPORT void
|
36
|
+
zactor_destroy (zactor_t **self_p);
|
37
|
+
|
38
|
+
// Send a zmsg message to the actor, take ownership of the message
|
39
|
+
// and destroy when it has been sent.
|
40
|
+
CZMQ_EXPORT int
|
41
|
+
zactor_send (zactor_t *self, zmsg_t **msg_p);
|
42
|
+
|
43
|
+
// Receive a zmsg message from the actor. Returns NULL if the actor
|
44
|
+
// was interrupted before the message could be received, or if there
|
45
|
+
// was a timeout on the actor.
|
46
|
+
// Caller owns return value and must destroy it when done.
|
47
|
+
CZMQ_EXPORT zmsg_t *
|
48
|
+
zactor_recv (zactor_t *self);
|
49
|
+
|
50
|
+
// Probe the supplied object, and report if it looks like a zactor_t.
|
51
|
+
CZMQ_EXPORT bool
|
52
|
+
zactor_is (void *self);
|
53
|
+
|
54
|
+
// Probe the supplied reference. If it looks like a zactor_t instance,
|
55
|
+
// return the underlying libzmq actor handle; else if it looks like
|
56
|
+
// a libzmq actor handle, return the supplied value.
|
57
|
+
CZMQ_EXPORT void *
|
58
|
+
zactor_resolve (void *self);
|
59
|
+
|
60
|
+
// Return the actor's zsock handle. Use this when you absolutely need
|
61
|
+
// to work with the zsock instance rather than the actor.
|
62
|
+
CZMQ_EXPORT zsock_t *
|
63
|
+
zactor_sock (zactor_t *self);
|
64
|
+
|
65
|
+
// Self test of this class.
|
66
|
+
CZMQ_EXPORT void
|
67
|
+
zactor_test (bool verbose);
|
68
|
+
|
69
|
+
// @end
|
70
|
+
|
71
|
+
|
72
|
+
#ifdef __cplusplus
|
73
|
+
}
|
74
|
+
#endif
|
75
|
+
|
76
|
+
#endif
|
@@ -0,0 +1,114 @@
|
|
1
|
+
/* =========================================================================
|
2
|
+
zarmour - armoured text encoding and decoding
|
3
|
+
|
4
|
+
Copyright (c) the Contributors as noted in the AUTHORS file.
|
5
|
+
This file is part of CZMQ, the high-level C binding for 0MQ:
|
6
|
+
http://czmq.zeromq.org.
|
7
|
+
|
8
|
+
This Source Code Form is subject to the terms of the Mozilla Public
|
9
|
+
License, v. 2.0. If a copy of the MPL was not distributed with this
|
10
|
+
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
11
|
+
=========================================================================
|
12
|
+
*/
|
13
|
+
|
14
|
+
#ifndef __ZARMOUR_H_INCLUDED__
|
15
|
+
#define __ZARMOUR_H_INCLUDED__
|
16
|
+
|
17
|
+
#ifdef __cplusplus
|
18
|
+
extern "C" {
|
19
|
+
#endif
|
20
|
+
|
21
|
+
// @warning THE FOLLOWING @INTERFACE BLOCK IS AUTO-GENERATED BY ZPROJECT
|
22
|
+
// @warning Please edit the model at "api/zarmour.api" to make changes.
|
23
|
+
// @interface
|
24
|
+
// This is a stable class, and may not change except for emergencies. It
|
25
|
+
// is provided in stable builds.
|
26
|
+
#define ZARMOUR_MODE_BASE64_STD 0 // Standard base 64
|
27
|
+
#define ZARMOUR_MODE_BASE64_URL 1 // URL and filename friendly base 64
|
28
|
+
#define ZARMOUR_MODE_BASE32_STD 2 // Standard base 32
|
29
|
+
#define ZARMOUR_MODE_BASE32_HEX 3 // Extended hex base 32
|
30
|
+
#define ZARMOUR_MODE_BASE16 4 // Standard base 16
|
31
|
+
#define ZARMOUR_MODE_Z85 5 // Z85 from ZeroMQ RFC 32
|
32
|
+
|
33
|
+
// Create a new zarmour
|
34
|
+
CZMQ_EXPORT zarmour_t *
|
35
|
+
zarmour_new (void);
|
36
|
+
|
37
|
+
// Destroy the zarmour
|
38
|
+
CZMQ_EXPORT void
|
39
|
+
zarmour_destroy (zarmour_t **self_p);
|
40
|
+
|
41
|
+
// Encode a stream of bytes into an armoured string. Returns the armoured
|
42
|
+
// string, or NULL if there was insufficient memory available to allocate
|
43
|
+
// a new string.
|
44
|
+
// Caller owns return value and must destroy it when done.
|
45
|
+
CZMQ_EXPORT char *
|
46
|
+
zarmour_encode (zarmour_t *self, const byte *data, size_t size);
|
47
|
+
|
48
|
+
// Decode an armoured string into a chunk. The decoded output is
|
49
|
+
// null-terminated, so it may be treated as a string, if that's what
|
50
|
+
// it was prior to encoding.
|
51
|
+
// Caller owns return value and must destroy it when done.
|
52
|
+
CZMQ_EXPORT zchunk_t *
|
53
|
+
zarmour_decode (zarmour_t *self, const char *data);
|
54
|
+
|
55
|
+
// Get the mode property.
|
56
|
+
CZMQ_EXPORT int
|
57
|
+
zarmour_mode (zarmour_t *self);
|
58
|
+
|
59
|
+
// Get printable string for mode.
|
60
|
+
CZMQ_EXPORT const char *
|
61
|
+
zarmour_mode_str (zarmour_t *self);
|
62
|
+
|
63
|
+
// Set the mode property.
|
64
|
+
CZMQ_EXPORT void
|
65
|
+
zarmour_set_mode (zarmour_t *self, int mode);
|
66
|
+
|
67
|
+
// Return true if padding is turned on.
|
68
|
+
CZMQ_EXPORT bool
|
69
|
+
zarmour_pad (zarmour_t *self);
|
70
|
+
|
71
|
+
// Turn padding on or off. Default is on.
|
72
|
+
CZMQ_EXPORT void
|
73
|
+
zarmour_set_pad (zarmour_t *self, bool pad);
|
74
|
+
|
75
|
+
// Get the padding character.
|
76
|
+
CZMQ_EXPORT char
|
77
|
+
zarmour_pad_char (zarmour_t *self);
|
78
|
+
|
79
|
+
// Set the padding character.
|
80
|
+
CZMQ_EXPORT void
|
81
|
+
zarmour_set_pad_char (zarmour_t *self, char pad_char);
|
82
|
+
|
83
|
+
// Return if splitting output into lines is turned on. Default is off.
|
84
|
+
CZMQ_EXPORT bool
|
85
|
+
zarmour_line_breaks (zarmour_t *self);
|
86
|
+
|
87
|
+
// Turn splitting output into lines on or off.
|
88
|
+
CZMQ_EXPORT void
|
89
|
+
zarmour_set_line_breaks (zarmour_t *self, bool line_breaks);
|
90
|
+
|
91
|
+
// Get the line length used for splitting lines.
|
92
|
+
CZMQ_EXPORT size_t
|
93
|
+
zarmour_line_length (zarmour_t *self);
|
94
|
+
|
95
|
+
// Set the line length used for splitting lines.
|
96
|
+
CZMQ_EXPORT void
|
97
|
+
zarmour_set_line_length (zarmour_t *self, size_t line_length);
|
98
|
+
|
99
|
+
// Print properties of object
|
100
|
+
CZMQ_EXPORT void
|
101
|
+
zarmour_print (zarmour_t *self);
|
102
|
+
|
103
|
+
// Self test of this class.
|
104
|
+
CZMQ_EXPORT void
|
105
|
+
zarmour_test (bool verbose);
|
106
|
+
|
107
|
+
// @end
|
108
|
+
|
109
|
+
|
110
|
+
#ifdef __cplusplus
|
111
|
+
}
|
112
|
+
#endif
|
113
|
+
|
114
|
+
#endif
|
@@ -0,0 +1,100 @@
|
|
1
|
+
/* =========================================================================
|
2
|
+
zauth - authentication for ZeroMQ security mechanisms
|
3
|
+
|
4
|
+
Copyright (c) the Contributors as noted in the AUTHORS file.
|
5
|
+
This file is part of CZMQ, the high-level C binding for 0MQ:
|
6
|
+
http://czmq.zeromq.org.
|
7
|
+
|
8
|
+
This Source Code Form is subject to the terms of the Mozilla Public
|
9
|
+
License, v. 2.0. If a copy of the MPL was not distributed with this
|
10
|
+
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
11
|
+
=========================================================================
|
12
|
+
*/
|
13
|
+
|
14
|
+
#ifndef __ZAUTH_H_INCLUDED__
|
15
|
+
#define __ZAUTH_H_INCLUDED__
|
16
|
+
|
17
|
+
#ifdef __cplusplus
|
18
|
+
extern "C" {
|
19
|
+
#endif
|
20
|
+
|
21
|
+
// @interface
|
22
|
+
#define CURVE_ALLOW_ANY "*"
|
23
|
+
|
24
|
+
// CZMQ v3 API (for use with zsock, not zsocket, which is deprecated).
|
25
|
+
//
|
26
|
+
// Create new zauth actor instance. This installs authentication on all
|
27
|
+
// zsock sockets. Until you add policies, all incoming NULL connections are
|
28
|
+
// allowed (classic ZeroMQ behaviour), and all PLAIN and CURVE connections
|
29
|
+
// are denied:
|
30
|
+
//
|
31
|
+
// zactor_t *auth = zactor_new (zauth, NULL);
|
32
|
+
//
|
33
|
+
// Destroy zauth instance. This removes authentication and allows all
|
34
|
+
// connections to pass, without authentication:
|
35
|
+
//
|
36
|
+
// zactor_destroy (&auth);
|
37
|
+
//
|
38
|
+
// Note that all zauth commands are synchronous, so your application always
|
39
|
+
// waits for a signal from the actor after each command.
|
40
|
+
//
|
41
|
+
// Enable verbose logging of commands and activity. Verbose logging can help
|
42
|
+
// debug non-trivial authentication policies:
|
43
|
+
//
|
44
|
+
// zstr_send (auth, "VERBOSE");
|
45
|
+
// zsock_wait (auth);
|
46
|
+
//
|
47
|
+
// Allow (whitelist) a list of IP addresses. For NULL, all clients from
|
48
|
+
// these addresses will be accepted. For PLAIN and CURVE, they will be
|
49
|
+
// allowed to continue with authentication. You can call this method
|
50
|
+
// multiple times to whitelist more IP addresses. If you whitelist one
|
51
|
+
// or nmore addresses, any non-whitelisted addresses are treated as
|
52
|
+
// blacklisted:
|
53
|
+
//
|
54
|
+
// zstr_sendx (auth, "ALLOW", "127.0.0.1", "127.0.0.2", NULL);
|
55
|
+
// zsock_wait (auth);
|
56
|
+
//
|
57
|
+
// Deny (blacklist) a list of IP addresses. For all security mechanisms,
|
58
|
+
// this rejects the connection without any further authentication. Use
|
59
|
+
// either a whitelist, or a blacklist, not not both. If you define both
|
60
|
+
// a whitelist and a blacklist, only the whitelist takes effect:
|
61
|
+
//
|
62
|
+
// zstr_sendx (auth, "DENY", "192.168.0.1", "192.168.0.2", NULL);
|
63
|
+
// zsock_wait (auth);
|
64
|
+
//
|
65
|
+
// Configure PLAIN authentication using a plain-text password file. You can
|
66
|
+
// modify the password file at any time; zauth will reload it automatically
|
67
|
+
// if modified externally:
|
68
|
+
//
|
69
|
+
// zstr_sendx (auth, "PLAIN", filename, NULL);
|
70
|
+
// zsock_wait (auth);
|
71
|
+
//
|
72
|
+
// Configure CURVE authentication, using a directory that holds all public
|
73
|
+
// client certificates, i.e. their public keys. The certificates must be in
|
74
|
+
// zcert_save format. You can add and remove certificates in that directory
|
75
|
+
// at any time. To allow all client keys without checking, specify
|
76
|
+
// CURVE_ALLOW_ANY for the directory name:
|
77
|
+
//
|
78
|
+
// zstr_sendx (auth, "CURVE", directory, NULL);
|
79
|
+
// zsock_wait (auth);
|
80
|
+
//
|
81
|
+
// Configure GSSAPI authentication, using an underlying mechanism (usually
|
82
|
+
// Kerberos) to establish a secure context and perform mutual authentication:
|
83
|
+
//
|
84
|
+
// zstr_sendx (auth, "GSSAPI", NULL);
|
85
|
+
// zsock_wait (auth);
|
86
|
+
//
|
87
|
+
// This is the zauth constructor as a zactor_fn:
|
88
|
+
CZMQ_EXPORT void
|
89
|
+
zauth (zsock_t *pipe, void *certstore);
|
90
|
+
|
91
|
+
// Selftest
|
92
|
+
CZMQ_EXPORT void
|
93
|
+
zauth_test (bool verbose);
|
94
|
+
// @end
|
95
|
+
|
96
|
+
#ifdef __cplusplus
|
97
|
+
}
|
98
|
+
#endif
|
99
|
+
|
100
|
+
#endif
|
@@ -0,0 +1,88 @@
|
|
1
|
+
/* =========================================================================
|
2
|
+
zauth_v2 - authentication for ZeroMQ servers (deprecated)
|
3
|
+
|
4
|
+
Copyright (c) the Contributors as noted in the AUTHORS file.
|
5
|
+
This file is part of CZMQ, the high-level C binding for 0MQ:
|
6
|
+
http://czmq.zeromq.org.
|
7
|
+
|
8
|
+
This Source Code Form is subject to the terms of the Mozilla Public
|
9
|
+
License, v. 2.0. If a copy of the MPL was not distributed with this
|
10
|
+
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
11
|
+
=========================================================================
|
12
|
+
*/
|
13
|
+
|
14
|
+
#ifndef __ZAUTH_V2_H_INCLUDED__
|
15
|
+
#define __ZAUTH_V2_H_INCLUDED__
|
16
|
+
|
17
|
+
#ifdef __cplusplus
|
18
|
+
extern "C" {
|
19
|
+
#endif
|
20
|
+
|
21
|
+
// @interface
|
22
|
+
#ifndef CURVE_ALLOW_ANY
|
23
|
+
# define CURVE_ALLOW_ANY "*"
|
24
|
+
#endif
|
25
|
+
|
26
|
+
// Constructor
|
27
|
+
// Install authentication for the specified context. Returns a new zauth
|
28
|
+
// object that you can use to configure authentication. Note that until you
|
29
|
+
// add policies, all incoming NULL connections are allowed (classic ZeroMQ
|
30
|
+
// behaviour), and all PLAIN and CURVE connections are denied. If there was
|
31
|
+
// an error during initialization, returns NULL.
|
32
|
+
CZMQ_EXPORT zauth_t *
|
33
|
+
zauth_new (zctx_t *ctx);
|
34
|
+
|
35
|
+
// Destructor
|
36
|
+
CZMQ_EXPORT void
|
37
|
+
zauth_destroy (zauth_t **self_p);
|
38
|
+
|
39
|
+
// Allow (whitelist) a single IP address. For NULL, all clients from this
|
40
|
+
// address will be accepted. For PLAIN and CURVE, they will be allowed to
|
41
|
+
// continue with authentication. You can call this method multiple times
|
42
|
+
// to whitelist multiple IP addresses. If you whitelist a single address,
|
43
|
+
// any non-whitelisted addresses are treated as blacklisted.
|
44
|
+
CZMQ_EXPORT void
|
45
|
+
zauth_allow (zauth_t *self, const char *address);
|
46
|
+
|
47
|
+
// Deny (blacklist) a single IP address. For all security mechanisms, this
|
48
|
+
// rejects the connection without any further authentication. Use either a
|
49
|
+
// whitelist, or a blacklist, not not both. If you define both a whitelist
|
50
|
+
// and a blacklist, only the whitelist takes effect.
|
51
|
+
CZMQ_EXPORT void
|
52
|
+
zauth_deny (zauth_t *self, const char *address);
|
53
|
+
|
54
|
+
// Configure PLAIN authentication for a given domain. PLAIN authentication
|
55
|
+
// uses a plain-text password file. To cover all domains, use "*". You can
|
56
|
+
// modify the password file at any time; it is reloaded automatically.
|
57
|
+
CZMQ_EXPORT void
|
58
|
+
zauth_configure_plain (zauth_t *self, const char *domain, const char *filename);
|
59
|
+
|
60
|
+
// Configure CURVE authentication for a given domain. CURVE authentication
|
61
|
+
// uses a directory that holds all public client certificates, i.e. their
|
62
|
+
// public keys. The certificates must be in zcert_save () format. To cover
|
63
|
+
// all domains, use "*". You can add and remove certificates in that
|
64
|
+
// directory at any time. To allow all client keys without checking, specify
|
65
|
+
// CURVE_ALLOW_ANY for the location.
|
66
|
+
CZMQ_EXPORT void
|
67
|
+
zauth_configure_curve (zauth_t *self, const char *domain, const char *location);
|
68
|
+
|
69
|
+
// Configure GSSAPI authentication for a given domain. GSSAPI authentication
|
70
|
+
// uses an underlying mechanism (usually Kerberos) to establish a secure
|
71
|
+
// context and perform mutual authentication. To cover all domains, use "*".
|
72
|
+
CZMQ_EXPORT void
|
73
|
+
zauth_configure_gssapi (zauth_t *self, char *domain);
|
74
|
+
|
75
|
+
// Enable verbose tracing of commands and activity
|
76
|
+
CZMQ_EXPORT void
|
77
|
+
zauth_set_verbose (zauth_t *self, bool verbose);
|
78
|
+
|
79
|
+
// Selftest
|
80
|
+
CZMQ_EXPORT void
|
81
|
+
zauth_v2_test (bool verbose);
|
82
|
+
// @end
|
83
|
+
|
84
|
+
#ifdef __cplusplus
|
85
|
+
}
|
86
|
+
#endif
|
87
|
+
|
88
|
+
#endif
|
@@ -0,0 +1,86 @@
|
|
1
|
+
/* =========================================================================
|
2
|
+
zbeacon - LAN discovery and presence
|
3
|
+
|
4
|
+
Copyright (c) the Contributors as noted in the AUTHORS file.
|
5
|
+
This file is part of CZMQ, the high-level C binding for 0MQ:
|
6
|
+
http://czmq.zeromq.org.
|
7
|
+
|
8
|
+
This Source Code Form is subject to the terms of the Mozilla Public
|
9
|
+
License, v. 2.0. If a copy of the MPL was not distributed with this
|
10
|
+
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
11
|
+
=========================================================================
|
12
|
+
*/
|
13
|
+
|
14
|
+
#ifndef __ZBEACON_H_INCLUDED__
|
15
|
+
#define __ZBEACON_H_INCLUDED__
|
16
|
+
|
17
|
+
#ifdef __cplusplus
|
18
|
+
extern "C" {
|
19
|
+
#endif
|
20
|
+
|
21
|
+
// @interface
|
22
|
+
// Create new zbeacon actor instance:
|
23
|
+
//
|
24
|
+
// zactor_t *beacon = zactor_new (zbeacon, NULL);
|
25
|
+
//
|
26
|
+
// Destroy zbeacon instance:
|
27
|
+
//
|
28
|
+
// zactor_destroy (&beacon);
|
29
|
+
//
|
30
|
+
// Enable verbose logging of commands and activity:
|
31
|
+
//
|
32
|
+
// zstr_send (beacon, "VERBOSE");
|
33
|
+
//
|
34
|
+
// Configure beacon to run on specified UDP port, and return the name of
|
35
|
+
// the host, which can be used as endpoint for incoming connections. To
|
36
|
+
// force the beacon to operate on a given interface, set the environment
|
37
|
+
// variable ZSYS_INTERFACE, or call zsys_set_interface() before creating
|
38
|
+
// the beacon. If the system does not support UDP broadcasts (lacking a
|
39
|
+
// workable interface), returns an empty hostname:
|
40
|
+
//
|
41
|
+
// // Pictures: 's' = C string, 'i' = int
|
42
|
+
// zsock_send (beacon, "si", "CONFIGURE", port_number);
|
43
|
+
// char *hostname = zstr_recv (beacon);
|
44
|
+
//
|
45
|
+
// Start broadcasting a beacon at a specified interval in msec. The beacon
|
46
|
+
// data can be at most UDP_FRAME_MAX bytes; this constant is defined in
|
47
|
+
// zsys.h to be 255:
|
48
|
+
//
|
49
|
+
// // Pictures: 'b' = byte * data + size_t size
|
50
|
+
// zsock_send (beacon, "sbi", "PUBLISH", data, size, interval);
|
51
|
+
//
|
52
|
+
// Stop broadcasting the beacon:
|
53
|
+
//
|
54
|
+
// zstr_sendx (beacon, "SILENCE", NULL);
|
55
|
+
//
|
56
|
+
// Start listening to beacons from peers. The filter is used to do a prefix
|
57
|
+
// match on received beacons, to remove junk. Note that any received data
|
58
|
+
// that is identical to our broadcast beacon_data is discarded in any case.
|
59
|
+
// If the filter size is zero, we get all peer beacons:
|
60
|
+
//
|
61
|
+
// zsock_send (beacon, "sb", "SUBSCRIBE", filter_data, filter_size);
|
62
|
+
//
|
63
|
+
// Stop listening to other peers
|
64
|
+
//
|
65
|
+
// zstr_sendx (beacon, "UNSUBSCRIBE", NULL);
|
66
|
+
//
|
67
|
+
// Receive next beacon from a peer. Received beacons are always a 2-frame
|
68
|
+
// message containing the ipaddress of the sender, and then the binary
|
69
|
+
// beacon data as published by the sender:
|
70
|
+
//
|
71
|
+
// zmsg_t *msg = zmsg_recv (beacon);
|
72
|
+
//
|
73
|
+
// This is the zbeacon constructor as a zactor_fn:
|
74
|
+
CZMQ_EXPORT void
|
75
|
+
zbeacon (zsock_t *pipe, void *unused);
|
76
|
+
|
77
|
+
// Self test of this class
|
78
|
+
CZMQ_EXPORT void
|
79
|
+
zbeacon_test (bool verbose);
|
80
|
+
// @end
|
81
|
+
|
82
|
+
#ifdef __cplusplus
|
83
|
+
}
|
84
|
+
#endif
|
85
|
+
|
86
|
+
#endif
|