aboutsummaryrefslogtreecommitdiff
path: root/src/cadet/gnunet-cadet.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-01-27 04:29:52 +0100
committerChristian Grothoff <christian@grothoff.org>2019-01-27 04:29:52 +0100
commit1c9f269ea5cadb20bb5f7fc209274ba5d6af4749 (patch)
treece241e18c8db4876be1fd7ed4d7b7460994fd815 /src/cadet/gnunet-cadet.c
parentf0b35049f6d9e743d2bc5fcf11664633d130d6fc (diff)
downloadgnunet-1c9f269ea5cadb20bb5f7fc209274ba5d6af4749.tar.gz
gnunet-1c9f269ea5cadb20bb5f7fc209274ba5d6af4749.zip
in principle finished with #5385, could use some testing...
Diffstat (limited to 'src/cadet/gnunet-cadet.c')
-rw-r--r--src/cadet/gnunet-cadet.c90
1 files changed, 0 insertions, 90 deletions
diff --git a/src/cadet/gnunet-cadet.c b/src/cadet/gnunet-cadet.c
index 9e2d105b3..dba517a7b 100644
--- a/src/cadet/gnunet-cadet.c
+++ b/src/cadet/gnunet-cadet.c
@@ -47,11 +47,6 @@ static char *peer_id;
47static int request_tunnels; 47static int request_tunnels;
48 48
49/** 49/**
50 * Option --tunnel
51 */
52static char *tunnel_id;
53
54/**
55 * Option --connection 50 * Option --connection
56 */ 51 */
57static char *conn_id; 52static char *conn_id;
@@ -602,47 +597,6 @@ tunnels_callback (void *cls,
602 597
603 598
604/** 599/**
605 * Method called to retrieve information about a specific tunnel the cadet peer
606 * has established, o`r is trying to establish.
607 *
608 * @param cls Closure.
609 * @param peer Peer towards whom the tunnel is directed.
610 * @param n_channels Number of channels.
611 * @param n_connections Number of connections.
612 * @param channels Channels.
613 * @param connections Connections.
614 * @param estate Encryption status.
615 * @param cstate Connectivity status.
616 */
617static void
618tunnel_callback (void *cls,
619 const struct GNUNET_PeerIdentity *peer,
620 unsigned int n_channels,
621 unsigned int n_connections,
622 const struct GNUNET_CADET_ChannelTunnelNumber *channels,
623 const struct GNUNET_CADET_ConnectionTunnelIdentifier *connections,
624 unsigned int estate,
625 unsigned int cstate)
626{
627 unsigned int i;
628
629 if (NULL != peer)
630 {
631 FPRINTF (stdout, "Tunnel %s\n", GNUNET_i2s_full (peer));
632 FPRINTF (stdout, "\t%u channels\n", n_channels);
633 for (i = 0; i < n_channels; i++)
634 FPRINTF (stdout, "\t\t%X\n", ntohl (channels[i].cn));
635 FPRINTF (stdout, "\t%u connections\n", n_connections);
636 for (i = 0; i < n_connections; i++)
637 FPRINTF (stdout, "\t\t%s\n", GNUNET_sh2s (&connections[i].connection_of_tunnel));
638 FPRINTF (stdout, "\tencryption state: %s\n", enc_2s (estate));
639 FPRINTF (stdout, "\tconnection state: %s\n", conn_2s (cstate));
640 }
641 GNUNET_SCHEDULER_shutdown ();
642}
643
644
645/**
646 * Call CADET's meta API, get all peers known to a peer. 600 * Call CADET's meta API, get all peers known to a peer.
647 * 601 *
648 * @param cls Closure (unused). 602 * @param cls Closure (unused).
@@ -702,37 +656,6 @@ get_tunnels (void *cls)
702 656
703 657
704/** 658/**
705 * Call CADET's monitor API, get info of one tunnel.
706 *
707 * @param cls Closure (unused).
708 */
709static void
710show_tunnel (void *cls)
711{
712 struct GNUNET_PeerIdentity pid;
713
714 job = NULL;
715 if (GNUNET_OK !=
716 GNUNET_CRYPTO_eddsa_public_key_from_string (tunnel_id,
717 strlen (tunnel_id),
718 &pid.public_key))
719 {
720 fprintf (stderr,
721 _("Invalid tunnel owner `%s'\n"),
722 tunnel_id);
723 GNUNET_SCHEDULER_shutdown ();
724 return;
725 }
726#if FIXME5385
727 GNUNET_CADET_get_tunnel (my_cfg,
728 &pid,
729 &tunnel_callback,
730 NULL);
731#endif
732}
733
734
735/**
736 * Call CADET's monitor API, get info of one channel. 659 * Call CADET's monitor API, get info of one channel.
737 * 660 *
738 * @param cls Closure (unused). 661 * @param cls Closure (unused).
@@ -787,7 +710,6 @@ run (void *cls,
787 target_port = args[1]; 710 target_port = args[1];
788 711
789 if ( (0 != (request_peers | request_tunnels) 712 if ( (0 != (request_peers | request_tunnels)
790 || NULL != tunnel_id
791 || NULL != conn_id 713 || NULL != conn_id
792 || NULL != channel_id) 714 || NULL != channel_id)
793 && target_id != NULL) 715 && target_id != NULL)
@@ -805,13 +727,6 @@ run (void *cls,
805 job = GNUNET_SCHEDULER_add_now (&show_peer, 727 job = GNUNET_SCHEDULER_add_now (&show_peer,
806 NULL); 728 NULL);
807 } 729 }
808 else if (NULL != tunnel_id)
809 {
810 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
811 "Show tunnel\n");
812 job = GNUNET_SCHEDULER_add_now (&show_tunnel,
813 NULL);
814 }
815 else if (NULL != channel_id) 730 else if (NULL != channel_id)
816 { 731 {
817 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 732 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -959,11 +874,6 @@ main (int argc,
959 "peers", 874 "peers",
960 gettext_noop ("Provide information about all peers"), 875 gettext_noop ("Provide information about all peers"),
961 &request_peers), 876 &request_peers),
962 GNUNET_GETOPT_option_string ('t',
963 "tunnel",
964 "TUNNEL_ID",
965 gettext_noop ("Provide information about a particular tunnel"),
966 &tunnel_id),
967 GNUNET_GETOPT_option_flag ('T', 877 GNUNET_GETOPT_option_flag ('T',
968 "tunnels", 878 "tunnels",
969 gettext_noop ("Provide information about all tunnels"), 879 gettext_noop ("Provide information about all tunnels"),