diff options
-rw-r--r-- | src/include/gnunet_core_service.h | 93 |
1 files changed, 2 insertions, 91 deletions
diff --git a/src/include/gnunet_core_service.h b/src/include/gnunet_core_service.h index 6b082601b..7d99563ea 100644 --- a/src/include/gnunet_core_service.h +++ b/src/include/gnunet_core_service.h | |||
@@ -91,28 +91,6 @@ struct GNUNET_CORE_Handle; | |||
91 | * @param cls closure | 91 | * @param cls closure |
92 | * @param peer peer identity this notification is about | 92 | * @param peer peer identity this notification is about |
93 | */ | 93 | */ |
94 | typedef void | ||
95 | (*GNUNET_CORE_ConnectEventHandler) (void *cls, | ||
96 | const struct GNUNET_PeerIdentity *peer); | ||
97 | |||
98 | |||
99 | /** | ||
100 | * Method called whenever a peer disconnects. | ||
101 | * | ||
102 | * @param cls closure | ||
103 | * @param peer peer identity this notification is about | ||
104 | */ | ||
105 | typedef void | ||
106 | (*GNUNET_CORE_DisconnectEventHandler) (void *cls, | ||
107 | const struct GNUNET_PeerIdentity *peer); | ||
108 | |||
109 | |||
110 | /** | ||
111 | * Method called whenever a given peer connects. | ||
112 | * | ||
113 | * @param cls closure | ||
114 | * @param peer peer identity this notification is about | ||
115 | */ | ||
116 | typedef void * | 94 | typedef void * |
117 | (*GNUNET_CORE_ConnectEventHandler) (void *cls, | 95 | (*GNUNET_CORE_ConnectEventHandler) (void *cls, |
118 | const struct GNUNET_PeerIdentity *peer, | 96 | const struct GNUNET_PeerIdentity *peer, |
@@ -208,73 +186,6 @@ typedef void | |||
208 | * connected to the core service | 186 | * connected to the core service |
209 | * @param connects function to call on peer connect, can be NULL | 187 | * @param connects function to call on peer connect, can be NULL |
210 | * @param disconnects function to call on peer disconnect / timeout, can be NULL | 188 | * @param disconnects function to call on peer disconnect / timeout, can be NULL |
211 | * @param inbound_notify function to call for all inbound messages, can be NULL | ||
212 | * note that the core is allowed to drop notifications about inbound | ||
213 | * messages if the client does not process them fast enough (for this | ||
214 | * notification type, a bounded queue is used) | ||
215 | * @param inbound_hdr_only set to #GNUNET_YES if @a inbound_notify will only read the | ||
216 | * `struct GNUNET_MessageHeader` and hence we do not need to give it the full message; | ||
217 | * can be used to improve efficiency, ignored if inbound_notify is NULL | ||
218 | * note that the core is allowed to drop notifications about inbound | ||
219 | * messages if the client does not process them fast enough (for this | ||
220 | * notification type, a bounded queue is used) | ||
221 | * @param outbound_notify function to call for all outbound messages, can be NULL; | ||
222 | * note that the core is allowed to drop notifications about outbound | ||
223 | * messages if the client does not process them fast enough (for this | ||
224 | * notification type, a bounded queue is used) | ||
225 | * @param outbound_hdr_only set to #GNUNET_YES if @a outbound_notify will only read the | ||
226 | * `struct GNUNET_MessageHeader` and hence we do not need to give it the full message | ||
227 | * can be used to improve efficiency, ignored if outbound_notify is NULL | ||
228 | * note that the core is allowed to drop notifications about outbound | ||
229 | * messages if the client does not process them fast enough (for this | ||
230 | * notification type, a bounded queue is used) | ||
231 | * @param handlers callbacks for messages we care about, NULL-terminated | ||
232 | * note that the core is allowed to drop notifications about inbound | ||
233 | * messages if the client does not process them fast enough (for this | ||
234 | * notification type, a bounded queue is used) | ||
235 | * @return handle to the core service (only useful for disconnect until @a init is called), | ||
236 | * NULL on error (in this case, init is never called) | ||
237 | */ | ||
238 | struct GNUNET_CORE_Handle * | ||
239 | GNUNET_CORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, | ||
240 | void *cls, | ||
241 | GNUNET_CORE_StartupCallback init, | ||
242 | GNUNET_CORE_ConnectEventHandler connects, | ||
243 | GNUNET_CORE_DisconnectEventHandler disconnects, | ||
244 | GNUNET_CORE_MessageCallback inbound_notify, | ||
245 | int inbound_hdr_only, | ||
246 | GNUNET_CORE_MessageCallback outbound_notify, | ||
247 | int outbound_hdr_only, | ||
248 | const struct GNUNET_CORE_MessageHandler *handlers); | ||
249 | |||
250 | /** | ||
251 | * Disconnect from the core service. This function can only | ||
252 | * be called *after* all pending #GNUNET_CORE_notify_transmit_ready | ||
253 | * requests have been explicitly cancelled. | ||
254 | * | ||
255 | * @param handle connection to core to disconnect | ||
256 | */ | ||
257 | void | ||
258 | GNUNET_CORE_disconnect (struct GNUNET_CORE_Handle *handle); | ||
259 | |||
260 | |||
261 | /** | ||
262 | * Connect to the core service. Note that the connection may complete | ||
263 | * (or fail) asynchronously. This function primarily causes the given | ||
264 | * callback notification functions to be invoked whenever the | ||
265 | * specified event happens. The maximum number of queued | ||
266 | * notifications (queue length) is per client; the queue is shared | ||
267 | * across all types of notifications. So a slow client that registers | ||
268 | * for @a outbound_notify also risks missing @a inbound_notify messages. | ||
269 | * Certain events (such as connect/disconnect notifications) are not | ||
270 | * subject to queue size limitations. | ||
271 | * | ||
272 | * @param cfg configuration to use | ||
273 | * @param cls closure for the various callbacks that follow (including handlers in the handlers array) | ||
274 | * @param init callback to call once we have successfully | ||
275 | * connected to the core service | ||
276 | * @param connects function to call on peer connect, can be NULL | ||
277 | * @param disconnects function to call on peer disconnect / timeout, can be NULL | ||
278 | * @param handlers callbacks for messages we care about, NULL-terminated | 189 | * @param handlers callbacks for messages we care about, NULL-terminated |
279 | * note that the core is allowed to drop notifications about inbound | 190 | * note that the core is allowed to drop notifications about inbound |
280 | * messages if the client does not process them fast enough (for this | 191 | * messages if the client does not process them fast enough (for this |
@@ -305,7 +216,7 @@ GNUNET_CORE_disconnect (struct GNUNET_CORE_Handle *handle); | |||
305 | * so that it is transmitted with the given @a priority and | 216 | * so that it is transmitted with the given @a priority and |
306 | * the given @a cork value. | 217 | * the given @a cork value. |
307 | * | 218 | * |
308 | * @param cork desired corking | 219 | * @param cork desired corking |
309 | * @param priority desired message priority | 220 | * @param priority desired message priority |
310 | * @param[out] flags set to `flags` value for #GNUNET_MQ_set_options() | 221 | * @param[out] flags set to `flags` value for #GNUNET_MQ_set_options() |
311 | * @return `extra` argument to give to #GNUNET_MQ_set_options() | 222 | * @return `extra` argument to give to #GNUNET_MQ_set_options() |
@@ -320,7 +231,7 @@ GNUNET_CORE_get_mq_options (int cork, | |||
320 | * Obtain the message queue for a connected peer. | 231 | * Obtain the message queue for a connected peer. |
321 | * | 232 | * |
322 | * @param h the core handle | 233 | * @param h the core handle |
323 | * @param pid the identity of the peer | 234 | * @param pid the identity of the peer |
324 | * @return NULL if @a pid is not connected | 235 | * @return NULL if @a pid is not connected |
325 | */ | 236 | */ |
326 | struct GNUNET_MQ_Handle * | 237 | struct GNUNET_MQ_Handle * |