aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_server_lib.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/gnunet_server_lib.h')
-rw-r--r--src/include/gnunet_server_lib.h122
1 files changed, 65 insertions, 57 deletions
diff --git a/src/include/gnunet_server_lib.h b/src/include/gnunet_server_lib.h
index 3ada838b6..e4b856db0 100644
--- a/src/include/gnunet_server_lib.h
+++ b/src/include/gnunet_server_lib.h
@@ -74,8 +74,7 @@ typedef void (*GNUNET_SERVER_MessageCallback) (void *cls,
74 struct GNUNET_SERVER_Client * 74 struct GNUNET_SERVER_Client *
75 client, 75 client,
76 const struct 76 const struct
77 GNUNET_MessageHeader * 77 GNUNET_MessageHeader * message);
78 message);
79 78
80 79
81 80
@@ -123,12 +122,12 @@ struct GNUNET_SERVER_MessageHandler
123 * @return handle for the new server, NULL on error 122 * @return handle for the new server, NULL on error
124 * (typically, "port" already in use) 123 * (typically, "port" already in use)
125 */ 124 */
126struct GNUNET_SERVER_Handle * 125struct GNUNET_SERVER_Handle
127GNUNET_SERVER_create_with_sockets (GNUNET_CONNECTION_AccessCheck access, void *access_cls, 126 *GNUNET_SERVER_create_with_sockets (GNUNET_CONNECTION_AccessCheck access,
128 struct GNUNET_NETWORK_Handle **lsocks, 127 void *access_cls,
129 struct GNUNET_TIME_Relative 128 struct GNUNET_NETWORK_Handle **lsocks,
130 idle_timeout, 129 struct GNUNET_TIME_Relative
131 int require_found); 130 idle_timeout, int require_found);
132 131
133/** 132/**
134 * Create a new server. 133 * Create a new server.
@@ -145,8 +144,9 @@ GNUNET_SERVER_create_with_sockets (GNUNET_CONNECTION_AccessCheck access, void *a
145 */ 144 */
146struct GNUNET_SERVER_Handle *GNUNET_SERVER_create (GNUNET_CONNECTION_AccessCheck 145struct GNUNET_SERVER_Handle *GNUNET_SERVER_create (GNUNET_CONNECTION_AccessCheck
147 access, void *access_cls, 146 access, void *access_cls,
148 struct sockaddr *const*serverAddr, 147 struct sockaddr *const
149 const socklen_t *socklen, 148 *serverAddr,
149 const socklen_t * socklen,
150 struct GNUNET_TIME_Relative 150 struct GNUNET_TIME_Relative
151 idle_timeout, 151 idle_timeout,
152 int require_found); 152 int require_found);
@@ -195,11 +195,11 @@ GNUNET_SERVER_add_handlers (struct GNUNET_SERVER_Handle *server,
195 * NULL if we are already going to notify someone else (busy) 195 * NULL if we are already going to notify someone else (busy)
196 */ 196 */
197struct GNUNET_CONNECTION_TransmitHandle 197struct GNUNET_CONNECTION_TransmitHandle
198 *GNUNET_SERVER_notify_transmit_ready (struct GNUNET_SERVER_Client *client, 198 *GNUNET_SERVER_notify_transmit_ready (struct GNUNET_SERVER_Client *client,
199 size_t size, 199 size_t size,
200 struct GNUNET_TIME_Relative timeout, 200 struct GNUNET_TIME_Relative timeout,
201 GNUNET_CONNECTION_TransmitReadyNotify 201 GNUNET_CONNECTION_TransmitReadyNotify
202 callback, void *callback_cls); 202 callback, void *callback_cls);
203 203
204 204
205/** 205/**
@@ -208,8 +208,7 @@ struct GNUNET_CONNECTION_TransmitHandle
208 * 208 *
209 * @param client the client to set the persistent flag on 209 * @param client the client to set the persistent flag on
210 */ 210 */
211void 211void GNUNET_SERVER_client_persist_ (struct GNUNET_SERVER_Client *client);
212GNUNET_SERVER_client_persist_ (struct GNUNET_SERVER_Client *client);
213 212
214/** 213/**
215 * Resume receiving from this client, we are done processing the 214 * Resume receiving from this client, we are done processing the
@@ -237,7 +236,7 @@ GNUNET_SERVER_receive_done (struct GNUNET_SERVER_Client *client, int success);
237 */ 236 */
238void 237void
239GNUNET_SERVER_client_set_timeout (struct GNUNET_SERVER_Client *client, 238GNUNET_SERVER_client_set_timeout (struct GNUNET_SERVER_Client *client,
240 struct GNUNET_TIME_Relative timeout); 239 struct GNUNET_TIME_Relative timeout);
241 240
242 241
243/** 242/**
@@ -248,7 +247,8 @@ GNUNET_SERVER_client_set_timeout (struct GNUNET_SERVER_Client *client,
248 * @param client client for which to disable the warning 247 * @param client client for which to disable the warning
249 */ 248 */
250void 249void
251GNUNET_SERVER_disable_receive_done_warning (struct GNUNET_SERVER_Client *client); 250GNUNET_SERVER_disable_receive_done_warning (struct GNUNET_SERVER_Client
251 *client);
252 252
253 253
254/** 254/**
@@ -364,9 +364,10 @@ void GNUNET_SERVER_disconnect_notify (struct GNUNET_SERVER_Handle *server,
364 * @param callback function to call on disconnect 364 * @param callback function to call on disconnect
365 * @param callback_cls closure for callback 365 * @param callback_cls closure for callback
366 */ 366 */
367void GNUNET_SERVER_disconnect_notify_cancel (struct GNUNET_SERVER_Handle *server, 367void GNUNET_SERVER_disconnect_notify_cancel (struct GNUNET_SERVER_Handle
368 GNUNET_SERVER_DisconnectCallback 368 *server,
369 callback, void *callback_cls); 369 GNUNET_SERVER_DisconnectCallback
370 callback, void *callback_cls);
370 371
371 372
372/** 373/**
@@ -392,8 +393,7 @@ void GNUNET_SERVER_client_disconnect (struct GNUNET_SERVER_Client *client);
392 * @param do_ignore GNUNET_YES to ignore, GNUNET_NO to restore default 393 * @param do_ignore GNUNET_YES to ignore, GNUNET_NO to restore default
393 */ 394 */
394void 395void
395GNUNET_SERVER_ignore_shutdown (struct GNUNET_SERVER_Handle *h, 396GNUNET_SERVER_ignore_shutdown (struct GNUNET_SERVER_Handle *h, int do_ignore);
396 int do_ignore);
397 397
398 398
399 399
@@ -405,8 +405,7 @@ GNUNET_SERVER_ignore_shutdown (struct GNUNET_SERVER_Handle *h,
405 * @param client handle to the client 405 * @param client handle to the client
406 * @return GNUNET_OK on success 406 * @return GNUNET_OK on success
407 */ 407 */
408int 408int GNUNET_SERVER_client_disable_corking (struct GNUNET_SERVER_Client *client);
409GNUNET_SERVER_client_disable_corking (struct GNUNET_SERVER_Client *client);
410 409
411 410
412/** 411/**
@@ -425,8 +424,8 @@ struct GNUNET_SERVER_TransmitContext;
425 * @return NULL on error 424 * @return NULL on error
426 */ 425 */
427struct GNUNET_SERVER_TransmitContext 426struct GNUNET_SERVER_TransmitContext
428 *GNUNET_SERVER_transmit_context_create (struct GNUNET_SERVER_Client 427 *GNUNET_SERVER_transmit_context_create (struct GNUNET_SERVER_Client
429 *client); 428 *client);
430 429
431 430
432/** 431/**
@@ -441,8 +440,8 @@ struct GNUNET_SERVER_TransmitContext
441 */ 440 */
442void 441void
443GNUNET_SERVER_transmit_context_append_data (struct GNUNET_SERVER_TransmitContext 442GNUNET_SERVER_transmit_context_append_data (struct GNUNET_SERVER_TransmitContext
444 *tc, const void *data, size_t length, 443 *tc, const void *data,
445 uint16_t type); 444 size_t length, uint16_t type);
446 445
447 446
448/** 447/**
@@ -454,8 +453,11 @@ GNUNET_SERVER_transmit_context_append_data (struct GNUNET_SERVER_TransmitContext
454 * @param msg message to append 453 * @param msg message to append
455 */ 454 */
456void 455void
457GNUNET_SERVER_transmit_context_append_message (struct GNUNET_SERVER_TransmitContext 456GNUNET_SERVER_transmit_context_append_message (struct
458 *tc, const struct GNUNET_MessageHeader *msg); 457 GNUNET_SERVER_TransmitContext
458 *tc,
459 const struct GNUNET_MessageHeader
460 *msg);
459 461
460 462
461/** 463/**
@@ -493,9 +495,10 @@ struct GNUNET_SERVER_NotificationContext;
493 * if the queue gets longer than this number of messages 495 * if the queue gets longer than this number of messages
494 * @return handle to the notification context 496 * @return handle to the notification context
495 */ 497 */
496struct GNUNET_SERVER_NotificationContext * 498struct GNUNET_SERVER_NotificationContext
497GNUNET_SERVER_notification_context_create (struct GNUNET_SERVER_Handle *server, 499 *GNUNET_SERVER_notification_context_create (struct GNUNET_SERVER_Handle
498 unsigned int queue_length); 500 *server,
501 unsigned int queue_length);
499 502
500 503
501/** 504/**
@@ -504,7 +507,9 @@ GNUNET_SERVER_notification_context_create (struct GNUNET_SERVER_Handle *server,
504 * @param nc context to destroy. 507 * @param nc context to destroy.
505 */ 508 */
506void 509void
507GNUNET_SERVER_notification_context_destroy (struct GNUNET_SERVER_NotificationContext *nc); 510GNUNET_SERVER_notification_context_destroy (struct
511 GNUNET_SERVER_NotificationContext
512 *nc);
508 513
509 514
510/** 515/**
@@ -514,8 +519,9 @@ GNUNET_SERVER_notification_context_destroy (struct GNUNET_SERVER_NotificationCon
514 * @param client client to add 519 * @param client client to add
515 */ 520 */
516void 521void
517GNUNET_SERVER_notification_context_add (struct GNUNET_SERVER_NotificationContext *nc, 522GNUNET_SERVER_notification_context_add (struct GNUNET_SERVER_NotificationContext
518 struct GNUNET_SERVER_Client *client); 523 *nc,
524 struct GNUNET_SERVER_Client *client);
519 525
520 526
521/** 527/**
@@ -528,10 +534,12 @@ GNUNET_SERVER_notification_context_add (struct GNUNET_SERVER_NotificationContext
528 * @param can_drop can this message be dropped due to queue length limitations 534 * @param can_drop can this message be dropped due to queue length limitations
529 */ 535 */
530void 536void
531GNUNET_SERVER_notification_context_unicast (struct GNUNET_SERVER_NotificationContext *nc, 537GNUNET_SERVER_notification_context_unicast (struct
532 struct GNUNET_SERVER_Client *client, 538 GNUNET_SERVER_NotificationContext
533 const struct GNUNET_MessageHeader *msg, 539 *nc,
534 int can_drop); 540 struct GNUNET_SERVER_Client *client,
541 const struct GNUNET_MessageHeader
542 *msg, int can_drop);
535 543
536 544
537/** 545/**
@@ -542,9 +550,11 @@ GNUNET_SERVER_notification_context_unicast (struct GNUNET_SERVER_NotificationCon
542 * @param can_drop can this message be dropped due to queue length limitations 550 * @param can_drop can this message be dropped due to queue length limitations
543 */ 551 */
544void 552void
545GNUNET_SERVER_notification_context_broadcast (struct GNUNET_SERVER_NotificationContext *nc, 553GNUNET_SERVER_notification_context_broadcast (struct
546 const struct GNUNET_MessageHeader *msg, 554 GNUNET_SERVER_NotificationContext
547 int can_drop); 555 *nc,
556 const struct GNUNET_MessageHeader
557 *msg, int can_drop);
548 558
549 559
550 560
@@ -562,10 +572,10 @@ struct GNUNET_SERVER_MessageStreamTokenizer;
562 * @param message the actual message 572 * @param message the actual message
563 */ 573 */
564typedef void (*GNUNET_SERVER_MessageTokenizerCallback) (void *cls, 574typedef void (*GNUNET_SERVER_MessageTokenizerCallback) (void *cls,
565 void *client, 575 void *client,
566 const struct 576 const struct
567 GNUNET_MessageHeader * 577 GNUNET_MessageHeader *
568 message); 578 message);
569 579
570 580
571/** 581/**
@@ -575,9 +585,9 @@ typedef void (*GNUNET_SERVER_MessageTokenizerCallback) (void *cls,
575 * @param cb_cls closure for cb 585 * @param cb_cls closure for cb
576 * @return handle to tokenizer 586 * @return handle to tokenizer
577 */ 587 */
578struct GNUNET_SERVER_MessageStreamTokenizer * 588struct GNUNET_SERVER_MessageStreamTokenizer
579GNUNET_SERVER_mst_create (GNUNET_SERVER_MessageTokenizerCallback cb, 589 *GNUNET_SERVER_mst_create (GNUNET_SERVER_MessageTokenizerCallback cb,
580 void *cb_cls); 590 void *cb_cls);
581 591
582 592
583/** 593/**
@@ -598,11 +608,9 @@ GNUNET_SERVER_mst_create (GNUNET_SERVER_MessageTokenizerCallback cb,
598 */ 608 */
599int 609int
600GNUNET_SERVER_mst_receive (struct GNUNET_SERVER_MessageStreamTokenizer *mst, 610GNUNET_SERVER_mst_receive (struct GNUNET_SERVER_MessageStreamTokenizer *mst,
601 void *client_identity, 611 void *client_identity,
602 const char *buf, 612 const char *buf,
603 size_t size, 613 size_t size, int purge, int one_shot);
604 int purge,
605 int one_shot);
606 614
607 615
608/** 616/**