aboutsummaryrefslogtreecommitdiff
path: root/src/cadet/gnunet-cadet.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cadet/gnunet-cadet.c')
-rw-r--r--src/cadet/gnunet-cadet.c54
1 files changed, 26 insertions, 28 deletions
diff --git a/src/cadet/gnunet-cadet.c b/src/cadet/gnunet-cadet.c
index 5c5ec54b9..14b499aae 100644
--- a/src/cadet/gnunet-cadet.c
+++ b/src/cadet/gnunet-cadet.c
@@ -191,11 +191,9 @@ conn_2s (uint16_t status)
191 * Stops monitoring activity. 191 * Stops monitoring activity.
192 * 192 *
193 * @param cls Closure (unused). 193 * @param cls Closure (unused).
194 * @param tc scheduler context
195 */ 194 */
196static void 195static void
197shutdown_task (void *cls, 196shutdown_task (void *cls)
198 const struct GNUNET_SCHEDULER_TaskContext *tc)
199{ 197{
200 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutdown\n"); 198 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutdown\n");
201 if (NULL != th) 199 if (NULL != th)
@@ -268,14 +266,14 @@ data_ready (void *cls, size_t size, void *buf)
268 * Task run in stdio mode, after some data is available at stdin. 266 * Task run in stdio mode, after some data is available at stdin.
269 * 267 *
270 * @param cls Closure (unused). 268 * @param cls Closure (unused).
271 * @param tc scheduler context
272 */ 269 */
273static void 270static void
274read_stdio (void *cls, 271read_stdio (void *cls)
275 const struct GNUNET_SCHEDULER_TaskContext *tc)
276{ 272{
277 static char buf[60000]; 273 static char buf[60000];
274 const struct GNUNET_SCHEDULER_TaskContext *tc;
278 275
276 tc = GNUNET_SCHEDULER_get_task_context ();
279 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 277 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
280 { 278 {
281 return; 279 return;
@@ -406,11 +404,13 @@ channel_incoming (void *cls,
406 * @brief Send an echo request to the remote peer. 404 * @brief Send an echo request to the remote peer.
407 * 405 *
408 * @param cls Closure (NULL). 406 * @param cls Closure (NULL).
409 * @param tc Task context.
410 */ 407 */
411static void 408static void
412send_echo (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 409send_echo (void *cls)
413{ 410{
411 const struct GNUNET_SCHEDULER_TaskContext *tc;
412
413 tc = GNUNET_SCHEDULER_get_task_context ();
414 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) || NULL == ch) 414 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) || NULL == ch)
415 return; 415 return;
416 416
@@ -426,10 +426,9 @@ send_echo (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
426 * Call CADET's monitor API, request debug dump on the service. 426 * Call CADET's monitor API, request debug dump on the service.
427 * 427 *
428 * @param cls Closure (unused). 428 * @param cls Closure (unused).
429 * @param tc TaskContext
430 */ 429 */
431static void 430static void
432request_dump (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 431request_dump (void *cls)
433{ 432{
434 GNUNET_CADET_request_dump (mh); 433 GNUNET_CADET_request_dump (mh);
435 GNUNET_SCHEDULER_cancel (sd); 434 GNUNET_SCHEDULER_cancel (sd);
@@ -441,10 +440,9 @@ request_dump (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
441 * Call CADET's monitor API, get info of one connection. 440 * Call CADET's monitor API, get info of one connection.
442 * 441 *
443 * @param cls Closure (unused). 442 * @param cls Closure (unused).
444 * @param tc TaskContext
445 */ 443 */
446static void 444static void
447create_channel (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 445create_channel (void *cls)
448{ 446{
449 struct GNUNET_PeerIdentity pid; 447 struct GNUNET_PeerIdentity pid;
450 enum GNUNET_CADET_ChannelOption opt; 448 enum GNUNET_CADET_ChannelOption opt;
@@ -703,11 +701,13 @@ tunnel_callback (void *cls,
703 * Call CADET's meta API, get all peers known to a peer. 701 * Call CADET's meta API, get all peers known to a peer.
704 * 702 *
705 * @param cls Closure (unused). 703 * @param cls Closure (unused).
706 * @param tc TaskContext
707 */ 704 */
708static void 705static void
709get_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 706get_peers (void *cls)
710{ 707{
708 const struct GNUNET_SCHEDULER_TaskContext *tc;
709
710 tc = GNUNET_SCHEDULER_get_task_context ();
711 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 711 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
712 { 712 {
713 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutdown\n"); 713 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutdown\n");
@@ -721,18 +721,17 @@ get_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
721 * Call CADET's monitor API, get info of one peer. 721 * Call CADET's monitor API, get info of one peer.
722 * 722 *
723 * @param cls Closure (unused). 723 * @param cls Closure (unused).
724 * @param tc TaskContext
725 */ 724 */
726static void 725static void
727show_peer (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 726show_peer (void *cls)
728{ 727{
729 struct GNUNET_PeerIdentity pid; 728 struct GNUNET_PeerIdentity pid;
730 729
731 if (GNUNET_OK != 730 if (GNUNET_OK !=
732 GNUNET_CRYPTO_eddsa_public_key_from_string (peer_id, 731 GNUNET_CRYPTO_eddsa_public_key_from_string (peer_id,
733 strlen (peer_id), 732 strlen (peer_id),
734 &pid.public_key)) 733 &pid.public_key))
735 { 734 {
736 fprintf (stderr, 735 fprintf (stderr,
737 _("Invalid peer ID `%s'\n"), 736 _("Invalid peer ID `%s'\n"),
738 peer_id); 737 peer_id);
@@ -746,11 +745,13 @@ show_peer (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
746 * Call CADET's meta API, get all tunnels known to a peer. 745 * Call CADET's meta API, get all tunnels known to a peer.
747 * 746 *
748 * @param cls Closure (unused). 747 * @param cls Closure (unused).
749 * @param tc TaskContext
750 */ 748 */
751static void 749static void
752get_tunnels (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 750get_tunnels (void *cls)
753{ 751{
752 const struct GNUNET_SCHEDULER_TaskContext *tc;
753
754 tc = GNUNET_SCHEDULER_get_task_context ();
754 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 755 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
755 { 756 {
756 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutdown\n"); 757 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutdown\n");
@@ -764,10 +765,9 @@ get_tunnels (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
764 * Call CADET's monitor API, get info of one tunnel. 765 * Call CADET's monitor API, get info of one tunnel.
765 * 766 *
766 * @param cls Closure (unused). 767 * @param cls Closure (unused).
767 * @param tc TaskContext
768 */ 768 */
769static void 769static void
770show_tunnel (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 770show_tunnel (void *cls)
771{ 771{
772 struct GNUNET_PeerIdentity pid; 772 struct GNUNET_PeerIdentity pid;
773 773
@@ -790,10 +790,9 @@ show_tunnel (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
790 * Call CADET's monitor API, get info of one channel. 790 * Call CADET's monitor API, get info of one channel.
791 * 791 *
792 * @param cls Closure (unused). 792 * @param cls Closure (unused).
793 * @param tc TaskContext
794 */ 793 */
795static void 794static void
796show_channel (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 795show_channel (void *cls)
797{ 796{
798 797
799} 798}
@@ -803,10 +802,9 @@ show_channel (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
803 * Call CADET's monitor API, get info of one connection. 802 * Call CADET's monitor API, get info of one connection.
804 * 803 *
805 * @param cls Closure (unused). 804 * @param cls Closure (unused).
806 * @param tc TaskContext
807 */ 805 */
808static void 806static void
809show_connection (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 807show_connection (void *cls)
810{ 808{
811 809
812} 810}