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.c89
1 files changed, 56 insertions, 33 deletions
diff --git a/src/cadet/gnunet-cadet.c b/src/cadet/gnunet-cadet.c
index c194a5bc1..57eeac735 100644
--- a/src/cadet/gnunet-cadet.c
+++ b/src/cadet/gnunet-cadet.c
@@ -772,15 +772,15 @@ run (void *cls,
772 && target_id != NULL) 772 && target_id != NULL)
773 { 773 {
774 FPRINTF (stderr, 774 FPRINTF (stderr,
775 _("You must NOT give a TARGET " 775 _("Extra arguments are not applicable "
776 "when using 'request all' options\n")); 776 "in combination with this option.\n"));
777 return; 777 return;
778 } 778 }
779 779
780 if (GNUNET_YES == dump) 780 if (GNUNET_YES == dump)
781 { 781 {
782 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 782 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
783 "requesting debug dump\n"); 783 "Requesting debug dump\n");
784 job = GNUNET_SCHEDULER_add_now (&request_dump, 784 job = GNUNET_SCHEDULER_add_now (&request_dump,
785 NULL); 785 NULL);
786 } 786 }
@@ -829,7 +829,7 @@ run (void *cls,
829 829
830 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 830 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
831 "Connecting to CADET service\n"); 831 "Connecting to CADET service\n");
832 mh = GNUNET_CADET_connecT (cfg); 832 mh = GNUNET_CADET_connect (cfg);
833 GNUNET_SCHEDULER_add_shutdown (&shutdown_task, 833 GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
834 NULL); 834 NULL);
835 if (NULL == mh) 835 if (NULL == mh)
@@ -844,7 +844,7 @@ run (void *cls,
844 GNUNET_CRYPTO_hash (listen_port, 844 GNUNET_CRYPTO_hash (listen_port,
845 strlen (listen_port), 845 strlen (listen_port),
846 &porthash); 846 &porthash);
847 lp = GNUNET_CADET_open_porT (mh, 847 lp = GNUNET_CADET_open_port (mh,
848 &porthash, 848 &porthash,
849 &channel_incoming, 849 &channel_incoming,
850 NULL, 850 NULL,
@@ -876,7 +876,7 @@ run (void *cls,
876 GNUNET_CRYPTO_hash (target_port, 876 GNUNET_CRYPTO_hash (target_port,
877 strlen(target_port), 877 strlen(target_port),
878 &porthash); 878 &porthash);
879 ch = GNUNET_CADET_channel_creatE (mh, 879 ch = GNUNET_CADET_channel_create (mh,
880 NULL, 880 NULL,
881 &pid, 881 &pid,
882 &porthash, 882 &porthash,
@@ -919,32 +919,55 @@ main (int argc,
919 char *const *argv) 919 char *const *argv)
920{ 920{
921 int res; 921 int res;
922 const char helpstr[] = "Create channels and retreive info about cadets status."; 922 const char helpstr[] = "Create tunnels and retrieve info about CADET's status.";
923 static const struct GNUNET_GETOPT_CommandLineOption options[] = { 923 struct GNUNET_GETOPT_CommandLineOption options[] = {
924 {'C', "connection", "CONNECTION_ID", 924 /* I would use the terminology 'circuit' here... --lynX */
925 gettext_noop ("provide information about a particular connection"), 925 GNUNET_GETOPT_OPTION_STRING ('C',
926 GNUNET_YES, &GNUNET_GETOPT_set_string, &conn_id}, 926 "connection",
927 {'e', "echo", NULL, 927 "CONNECTION_ID",
928 gettext_noop ("activate echo mode"), 928 gettext_noop ("Provide information about a particular connection"),
929 GNUNET_NO, &GNUNET_GETOPT_set_one, &echo}, 929 &conn_id),
930 {'d', "dump", NULL, 930
931 gettext_noop ("dump debug information to STDERR"), 931 GNUNET_GETOPT_OPTION_SET_ONE ('e',
932 GNUNET_NO, &GNUNET_GETOPT_set_one, &dump}, 932 "echo",
933 {'o', "open-port", "PORT", 933 gettext_noop ("Activate echo mode"),
934 gettext_noop ("port to listen to"), 934 &echo),
935 GNUNET_YES, &GNUNET_GETOPT_set_string, &listen_port}, 935
936 {'p', "peer", "PEER_ID", 936 GNUNET_GETOPT_OPTION_SET_ONE ('d',
937 gettext_noop ("provide information about a patricular peer"), 937 "dump",
938 GNUNET_YES, &GNUNET_GETOPT_set_string, &peer_id}, 938 gettext_noop ("Dump debug information to STDERR"),
939 {'P', "peers", NULL, 939 &dump),
940 gettext_noop ("provide information about all peers"), 940
941 GNUNET_NO, &GNUNET_GETOPT_set_one, &request_peers}, 941 GNUNET_GETOPT_OPTION_STRING ('o',
942 {'t', "tunnel", "TUNNEL_ID", 942 "open-port",
943 gettext_noop ("provide information about a particular tunnel"), 943 "SHARED_SECRET",
944 GNUNET_YES, &GNUNET_GETOPT_set_string, &tunnel_id}, 944 gettext_noop ("Listen for connections using a shared secret among sender and recipient"),
945 {'T', "tunnels", NULL, 945 &listen_port),
946 gettext_noop ("provide information about all tunnels"), 946
947 GNUNET_NO, &GNUNET_GETOPT_set_one, &request_tunnels}, 947
948 GNUNET_GETOPT_OPTION_STRING ('p',
949 "peer",
950 "PEER_ID",
951 gettext_noop ("Provide information about a patricular peer"),
952 &peer_id),
953
954
955 GNUNET_GETOPT_OPTION_SET_ONE ('P',
956 "peers",
957 gettext_noop ("Provide information about all peers"),
958 &request_peers),
959
960 GNUNET_GETOPT_OPTION_STRING ('t',
961 "tunnel",
962 "TUNNEL_ID",
963 gettext_noop ("Provide information about a particular tunnel"),
964 &tunnel_id),
965
966
967 GNUNET_GETOPT_OPTION_SET_ONE ('T',
968 "tunnels",
969 gettext_noop ("Provide information about all tunnels"),
970 &request_tunnels),
948 971
949 GNUNET_GETOPT_OPTION_END 972 GNUNET_GETOPT_OPTION_END
950 }; 973 };
@@ -955,7 +978,7 @@ main (int argc,
955 return 2; 978 return 2;
956 979
957 res = GNUNET_PROGRAM_run (argc, argv, 980 res = GNUNET_PROGRAM_run (argc, argv,
958 "gnunet-cadet (OPTIONS | TARGET PORT)", 981 "gnunet-cadet (OPTIONS | PEER_ID SHARED_SECRET)",
959 gettext_noop (helpstr), 982 gettext_noop (helpstr),
960 options, &run, NULL); 983 options, &run, NULL);
961 984