diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-06-21 21:06:48 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-06-21 21:06:48 +0000 |
commit | 46cfd0e998c3946f75b7dd7376fc7587a6f4b562 (patch) | |
tree | a45c98420c67e06a99dd83c22b62e2bc8a48f3c7 /src/include/gnunet_server_lib.h | |
parent | 79437ecb24ce042d8c7e92d80da2276536bb2b86 (diff) | |
download | gnunet-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.h | 54 |
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 | */ | ||
616 | struct 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 | */ | ||
626 | typedef 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 | */ | ||
642 | struct GNUNET_SERVER_MessageStreamTokenizer * | ||
643 | GNUNET_SERVER_mst_create (size_t maxbuf, | ||
644 | void *client_identity, | ||
645 | GNUNET_SERVER_MessageTokenizerCallback cb, | ||
646 | void *cls); | ||
647 | |||
648 | |||
649 | /** | ||
650 | * | ||
651 | */ | ||
652 | void | ||
653 | GNUNET_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 | */ | ||
663 | void | ||
664 | GNUNET_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 |