| 1 | /* |
| 2 | Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file |
| 3 | |
| 4 | This file is part of libzmq, the ZeroMQ core engine in C++. |
| 5 | |
| 6 | libzmq is free software; you can redistribute it and/or modify it under |
| 7 | the terms of the GNU Lesser General Public License (LGPL) as published |
| 8 | by the Free Software Foundation; either version 3 of the License, or |
| 9 | (at your option) any later version. |
| 10 | |
| 11 | As a special exception, the Contributors give you permission to link |
| 12 | this library with independent modules to produce an executable, |
| 13 | regardless of the license terms of these independent modules, and to |
| 14 | copy and distribute the resulting executable under terms of your choice, |
| 15 | provided that you also meet, for each linked independent module, the |
| 16 | terms and conditions of the license of that module. An independent |
| 17 | module is a module which is not derived from or based on this library. |
| 18 | If you modify this library, you must extend this exception to your |
| 19 | version of the library. |
| 20 | |
| 21 | libzmq is distributed in the hope that it will be useful, but WITHOUT |
| 22 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 23 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public |
| 24 | License for more details. |
| 25 | |
| 26 | You should have received a copy of the GNU Lesser General Public License |
| 27 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 28 | */ |
| 29 | |
| 30 | #ifndef __ZMQ_DRAFT_H_INCLUDED__ |
| 31 | #define __ZMQ_DRAFT_H_INCLUDED__ |
| 32 | |
| 33 | /******************************************************************************/ |
| 34 | /* These functions are DRAFT and disabled in stable releases, and subject to */ |
| 35 | /* change at ANY time until declared stable. */ |
| 36 | /******************************************************************************/ |
| 37 | |
| 38 | #ifndef ZMQ_BUILD_DRAFT_API |
| 39 | |
| 40 | /* DRAFT Socket types. */ |
| 41 | #define ZMQ_SERVER 12 |
| 42 | #define ZMQ_CLIENT 13 |
| 43 | #define ZMQ_RADIO 14 |
| 44 | #define ZMQ_DISH 15 |
| 45 | #define ZMQ_GATHER 16 |
| 46 | #define ZMQ_SCATTER 17 |
| 47 | #define ZMQ_DGRAM 18 |
| 48 | |
| 49 | /* DRAFT Socket options. */ |
| 50 | #define ZMQ_ZAP_ENFORCE_DOMAIN 93 |
| 51 | #define ZMQ_LOOPBACK_FASTPATH 94 |
| 52 | #define ZMQ_METADATA 95 |
| 53 | #define ZMQ_MULTICAST_LOOP 96 |
| 54 | #define ZMQ_ROUTER_NOTIFY 97 |
| 55 | #define ZMQ_XPUB_MANUAL_LAST_VALUE 98 |
| 56 | #define ZMQ_SOCKS_USERNAME 99 |
| 57 | #define ZMQ_SOCKS_PASSWORD 100 |
| 58 | #define ZMQ_IN_BATCH_SIZE 101 |
| 59 | #define ZMQ_OUT_BATCH_SIZE 102 |
| 60 | #define ZMQ_ONLY_FIRST_SUBSCRIBE 108 |
| 61 | |
| 62 | |
| 63 | /* DRAFT Context options */ |
| 64 | #define ZMQ_ZERO_COPY_RECV 10 |
| 65 | |
| 66 | /* DRAFT Context methods. */ |
| 67 | int zmq_ctx_set_ext (void *context_, |
| 68 | int option_, |
| 69 | const void *optval_, |
| 70 | size_t optvallen_); |
| 71 | int zmq_ctx_get_ext (void *context_, |
| 72 | int option_, |
| 73 | void *optval_, |
| 74 | size_t *optvallen_); |
| 75 | |
| 76 | /* DRAFT Socket methods. */ |
| 77 | int zmq_join (void *s_, const char *group_); |
| 78 | int zmq_leave (void *s_, const char *group_); |
| 79 | |
| 80 | /* DRAFT Msg methods. */ |
| 81 | int zmq_msg_set_routing_id (zmq_msg_t *msg_, uint32_t routing_id_); |
| 82 | uint32_t zmq_msg_routing_id (zmq_msg_t *msg_); |
| 83 | int zmq_msg_set_group (zmq_msg_t *msg_, const char *group_); |
| 84 | const char *zmq_msg_group (zmq_msg_t *msg_); |
| 85 | |
| 86 | /* DRAFT Msg property names. */ |
| 87 | #define ZMQ_MSG_PROPERTY_ROUTING_ID "Routing-Id" |
| 88 | #define ZMQ_MSG_PROPERTY_SOCKET_TYPE "Socket-Type" |
| 89 | #define ZMQ_MSG_PROPERTY_USER_ID "User-Id" |
| 90 | #define ZMQ_MSG_PROPERTY_PEER_ADDRESS "Peer-Address" |
| 91 | |
| 92 | /* Router notify options */ |
| 93 | #define ZMQ_NOTIFY_CONNECT 1 |
| 94 | #define ZMQ_NOTIFY_DISCONNECT 2 |
| 95 | |
| 96 | /******************************************************************************/ |
| 97 | /* Poller polling on sockets,fd and thread-safe sockets */ |
| 98 | /******************************************************************************/ |
| 99 | |
| 100 | #if defined _WIN32 |
| 101 | typedef SOCKET zmq_fd_t; |
| 102 | #else |
| 103 | typedef int zmq_fd_t; |
| 104 | #endif |
| 105 | |
| 106 | typedef struct zmq_poller_event_t |
| 107 | { |
| 108 | void *socket; |
| 109 | zmq_fd_t fd; |
| 110 | void *user_data; |
| 111 | short events; |
| 112 | } zmq_poller_event_t; |
| 113 | |
| 114 | void *zmq_poller_new (void); |
| 115 | int zmq_poller_destroy (void **poller_p_); |
| 116 | int zmq_poller_add (void *poller_, |
| 117 | void *socket_, |
| 118 | void *user_data_, |
| 119 | short events_); |
| 120 | int zmq_poller_modify (void *poller_, void *socket_, short events_); |
| 121 | int zmq_poller_remove (void *poller_, void *socket_); |
| 122 | int zmq_poller_wait (void *poller_, zmq_poller_event_t *event_, long timeout_); |
| 123 | int zmq_poller_wait_all (void *poller_, |
| 124 | zmq_poller_event_t *events_, |
| 125 | int n_events_, |
| 126 | long timeout_); |
| 127 | zmq_fd_t zmq_poller_fd (void *poller_); |
| 128 | |
| 129 | int zmq_poller_add_fd (void *poller_, |
| 130 | zmq_fd_t fd_, |
| 131 | void *user_data_, |
| 132 | short events_); |
| 133 | int zmq_poller_modify_fd (void *poller_, zmq_fd_t fd_, short events_); |
| 134 | int zmq_poller_remove_fd (void *poller_, zmq_fd_t fd_); |
| 135 | |
| 136 | int zmq_socket_get_peer_state (void *socket_, |
| 137 | const void *routing_id_, |
| 138 | size_t routing_id_size_); |
| 139 | |
| 140 | /* DRAFT Socket monitoring events */ |
| 141 | #define ZMQ_EVENT_PIPES_STATS 0x10000 |
| 142 | |
| 143 | #define ZMQ_CURRENT_EVENT_VERSION 1 |
| 144 | #define ZMQ_CURRENT_EVENT_VERSION_DRAFT 2 |
| 145 | |
| 146 | #define ZMQ_EVENT_ALL_V1 ZMQ_EVENT_ALL |
| 147 | #define ZMQ_EVENT_ALL_V2 ZMQ_EVENT_ALL_V1 | ZMQ_EVENT_PIPES_STATS |
| 148 | |
| 149 | int zmq_socket_monitor_versioned ( |
| 150 | void *s_, const char *addr_, uint64_t events_, int event_version_, int type_); |
| 151 | int zmq_socket_monitor_pipes_stats (void *s_); |
| 152 | |
| 153 | #endif // ZMQ_BUILD_DRAFT_API |
| 154 | |
| 155 | #endif //ifndef __ZMQ_DRAFT_H_INCLUDED__ |
| 156 | |