czmq-ffi-gen 0.9.1-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. checksums.yaml +7 -0
  2. data/AUTHORS +1 -0
  3. data/CHANGES.md +88 -0
  4. data/Gemfile +2 -0
  5. data/LICENSE +14 -0
  6. data/README.md +112 -0
  7. data/lib/czmq-ffi-gen.rb +7 -0
  8. data/lib/czmq-ffi-gen/czmq/ffi.rb +1210 -0
  9. data/lib/czmq-ffi-gen/czmq/ffi/version.rb +15 -0
  10. data/lib/czmq-ffi-gen/czmq/ffi/zactor.rb +186 -0
  11. data/lib/czmq-ffi-gen/czmq/ffi/zarmour.rb +286 -0
  12. data/lib/czmq-ffi-gen/czmq/ffi/zcert.rb +307 -0
  13. data/lib/czmq-ffi-gen/czmq/ffi/zcertstore.rb +222 -0
  14. data/lib/czmq-ffi-gen/czmq/ffi/zchunk.rb +388 -0
  15. data/lib/czmq-ffi-gen/czmq/ffi/zclock.rb +140 -0
  16. data/lib/czmq-ffi-gen/czmq/ffi/zconfig.rb +442 -0
  17. data/lib/czmq-ffi-gen/czmq/ffi/zdigest.rb +156 -0
  18. data/lib/czmq-ffi-gen/czmq/ffi/zdir.rb +283 -0
  19. data/lib/czmq-ffi-gen/czmq/ffi/zdir_patch.rb +194 -0
  20. data/lib/czmq-ffi-gen/czmq/ffi/zfile.rb +353 -0
  21. data/lib/czmq-ffi-gen/czmq/ffi/zframe.rb +359 -0
  22. data/lib/czmq-ffi-gen/czmq/ffi/zhash.rb +416 -0
  23. data/lib/czmq-ffi-gen/czmq/ffi/zhashx.rb +659 -0
  24. data/lib/czmq-ffi-gen/czmq/ffi/ziflist.rb +189 -0
  25. data/lib/czmq-ffi-gen/czmq/ffi/zlist.rb +365 -0
  26. data/lib/czmq-ffi-gen/czmq/ffi/zlistx.rb +478 -0
  27. data/lib/czmq-ffi-gen/czmq/ffi/zloop.rb +396 -0
  28. data/lib/czmq-ffi-gen/czmq/ffi/zmsg.rb +515 -0
  29. data/lib/czmq-ffi-gen/czmq/ffi/zpoller.rb +194 -0
  30. data/lib/czmq-ffi-gen/czmq/ffi/zproc.rb +294 -0
  31. data/lib/czmq-ffi-gen/czmq/ffi/zsock.rb +3479 -0
  32. data/lib/czmq-ffi-gen/czmq/ffi/zstr.rb +203 -0
  33. data/lib/czmq-ffi-gen/czmq/ffi/ztimerset.rb +203 -0
  34. data/lib/czmq-ffi-gen/czmq/ffi/ztrie.rb +221 -0
  35. data/lib/czmq-ffi-gen/czmq/ffi/zuuid.rb +227 -0
  36. data/lib/czmq-ffi-gen/errors.rb +12 -0
  37. data/lib/czmq-ffi-gen/gem_version.rb +5 -0
  38. data/lib/czmq-ffi-gen/legacy.rb +16 -0
  39. data/lib/czmq-ffi-gen/libzmq.rb +18 -0
  40. data/lib/czmq-ffi-gen/signals.rb +27 -0
  41. data/lib/czmq-ffi-gen/vendor.rb +5 -0
  42. data/lib/czmq-ffi-gen/versions.rb +19 -0
  43. data/vendor/local/bin/inproc_lat.exe +0 -0
  44. data/vendor/local/bin/inproc_thr.exe +0 -0
  45. data/vendor/local/bin/libczmq.dll +0 -0
  46. data/vendor/local/bin/libgcc_s_sjlj-1.dll +0 -0
  47. data/vendor/local/bin/libstdc++-6.dll +0 -0
  48. data/vendor/local/bin/libzmq.dll +0 -0
  49. data/vendor/local/bin/local_lat.exe +0 -0
  50. data/vendor/local/bin/local_thr.exe +0 -0
  51. data/vendor/local/bin/remote_lat.exe +0 -0
  52. data/vendor/local/bin/remote_thr.exe +0 -0
  53. data/vendor/local/include/czmq.h +31 -0
  54. data/vendor/local/include/czmq_library.h +199 -0
  55. data/vendor/local/include/czmq_prelude.h +641 -0
  56. data/vendor/local/include/readme.txt +83 -0
  57. data/vendor/local/include/sha1.h +76 -0
  58. data/vendor/local/include/sha1.inc_c +335 -0
  59. data/vendor/local/include/slre.h +92 -0
  60. data/vendor/local/include/slre.inc_c +660 -0
  61. data/vendor/local/include/zactor.h +76 -0
  62. data/vendor/local/include/zarmour.h +114 -0
  63. data/vendor/local/include/zauth.h +100 -0
  64. data/vendor/local/include/zauth_v2.h +88 -0
  65. data/vendor/local/include/zbeacon.h +86 -0
  66. data/vendor/local/include/zbeacon_v2.h +75 -0
  67. data/vendor/local/include/zcert.h +136 -0
  68. data/vendor/local/include/zcertstore.h +100 -0
  69. data/vendor/local/include/zchunk.h +163 -0
  70. data/vendor/local/include/zclock.h +73 -0
  71. data/vendor/local/include/zconfig.h +185 -0
  72. data/vendor/local/include/zctx.h +107 -0
  73. data/vendor/local/include/zdigest.h +65 -0
  74. data/vendor/local/include/zdir.h +149 -0
  75. data/vendor/local/include/zdir_patch.h +82 -0
  76. data/vendor/local/include/zfile.h +177 -0
  77. data/vendor/local/include/zframe.h +176 -0
  78. data/vendor/local/include/zgossip.h +95 -0
  79. data/vendor/local/include/zgossip_engine.inc +927 -0
  80. data/vendor/local/include/zgossip_msg.h +129 -0
  81. data/vendor/local/include/zhash.h +195 -0
  82. data/vendor/local/include/zhash_primes.inc +329 -0
  83. data/vendor/local/include/zhashx.h +298 -0
  84. data/vendor/local/include/ziflist.h +77 -0
  85. data/vendor/local/include/zlist.h +158 -0
  86. data/vendor/local/include/zlistx.h +205 -0
  87. data/vendor/local/include/zloop.h +168 -0
  88. data/vendor/local/include/zmonitor.h +73 -0
  89. data/vendor/local/include/zmonitor_v2.h +56 -0
  90. data/vendor/local/include/zmq.h +617 -0
  91. data/vendor/local/include/zmq_utils.h +48 -0
  92. data/vendor/local/include/zmsg.h +280 -0
  93. data/vendor/local/include/zmutex.h +55 -0
  94. data/vendor/local/include/zpoller.h +92 -0
  95. data/vendor/local/include/zproc.h +168 -0
  96. data/vendor/local/include/zproxy.h +111 -0
  97. data/vendor/local/include/zproxy_v2.h +62 -0
  98. data/vendor/local/include/zrex.h +82 -0
  99. data/vendor/local/include/zsock.h +912 -0
  100. data/vendor/local/include/zsock_option.inc +4126 -0
  101. data/vendor/local/include/zsocket.h +110 -0
  102. data/vendor/local/include/zsockopt.h +256 -0
  103. data/vendor/local/include/zstr.h +110 -0
  104. data/vendor/local/include/zsys.h +386 -0
  105. data/vendor/local/include/zthread.h +50 -0
  106. data/vendor/local/include/ztimerset.h +90 -0
  107. data/vendor/local/include/ztrie.h +106 -0
  108. data/vendor/local/include/zuuid.h +96 -0
  109. data/vendor/local/lib/libczmq.dll.a +0 -0
  110. data/vendor/local/lib/liblibzmq.dll.a +0 -0
  111. data/vendor/local/lib/libzmq-static.a +0 -0
  112. data/vendor/local/lib/pkgconfig/libczmq.pc +23 -0
  113. data/vendor/local/lib/pkgconfig/libzmq.pc +11 -0
  114. data/vendor/local/share/zmq/AUTHORS.txt +147 -0
  115. data/vendor/local/share/zmq/COPYING.LESSER.txt +181 -0
  116. data/vendor/local/share/zmq/COPYING.txt +674 -0
  117. data/vendor/local/share/zmq/NEWS.txt +978 -0
  118. 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