aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_server_lib.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-06-21 21:06:48 +0000
committerChristian Grothoff <christian@grothoff.org>2010-06-21 21:06:48 +0000
commit46cfd0e998c3946f75b7dd7376fc7587a6f4b562 (patch)
treea45c98420c67e06a99dd83c22b62e2bc8a48f3c7 /src/include/gnunet_server_lib.h
parent79437ecb24ce042d8c7e92d80da2276536bb2b86 (diff)
downloadgnunet-46cfd0e998c3946f75b7dd7376fc7587a6f4b562.tar.gz
gnunet-46cfd0e998c3946f75b7dd7376fc7587a6f4b562.zip
nate on code sonar crack
Diffstat (limited to 'src/include/gnunet_server_lib.h')
-rw-r--r--src/include/gnunet_server_lib.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/include/gnunet_server_lib.h b/src/include/gnunet_server_lib.h
index a24e709dc..ababbeea9 100644
--- a/src/include/gnunet_server_lib.h
+++ b/src/include/gnunet_server_lib.h
@@ -610,6 +610,60 @@ GNUNET_SERVER_notification_context_broadcast (struct GNUNET_SERVER_NotificationC
610 610
611 611
612 612
613/**
614 * Handle to a message stream tokenizer.
615 */
616struct GNUNET_SERVER_MessageStreamTokenizer;
617
618/**
619 * Functions with this signature are called whenever a
620 * complete message is received by the tokenizer.
621 *
622 * @param cls closure
623 * @param client identification of the client
624 * @param message the actual message
625 */
626typedef void (*GNUNET_SERVER_MessageTokenizerCallback) (void *cls,
627 void *client,
628 const struct
629 GNUNET_MessageHeader *
630 message);
631
632
633/**
634 * Create a message stream tokenizer.
635 *
636 * @param maxbuf maximum message size to support (typically
637 * GNUNET_SERVER_MAX_MESSAGE_SIZE)
638 * @param client_identity ID of client for which this is a buffer,
639 * can be NULL (will be passed back to 'cb')
640 * @return handle to tokenizer
641 */
642struct GNUNET_SERVER_MessageStreamTokenizer *
643GNUNET_SERVER_mst_create (size_t maxbuf,
644 void *client_identity,
645 GNUNET_SERVER_MessageTokenizerCallback cb,
646 void *cls);
647
648
649/**
650 *
651 */
652void
653GNUNET_SERVER_mst_receive (struct GNUNET_SERVER_MessageStreamTokenizer *mst,
654 const char *buf,
655 size_t size,
656 int purge);
657
658/**
659 * Destroys a tokenizer.
660 *
661 * @param mst tokenizer to destroy
662 */
663void
664GNUNET_SERVER_mst_destroy (struct GNUNET_SERVER_MessageStreamTokenizer *mst);
665
666
613#if 0 /* keep Emacsens' auto-indent happy */ 667#if 0 /* keep Emacsens' auto-indent happy */
614{ 668{
615#endif 669#endif