gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r17803 - in gnunet: doc/man src/transport


From: gnunet
Subject: [GNUnet-SVN] r17803 - in gnunet: doc/man src/transport
Date: Wed, 26 Oct 2011 23:00:53 +0200

Author: grothoff
Date: 2011-10-26 23:00:53 +0200 (Wed, 26 Oct 2011)
New Revision: 17803

Added:
   gnunet/doc/man/gnunet-transport.1
Modified:
   gnunet/doc/man/Makefile.am
   gnunet/doc/man/gnunet-directory.1
   gnunet/doc/man/gnunet-nat-server.1
   gnunet/src/transport/gnunet-transport.c
Log:
documenting gnunet-transport a bit

Modified: gnunet/doc/man/Makefile.am
===================================================================
--- gnunet/doc/man/Makefile.am  2011-10-26 19:27:43 UTC (rev 17802)
+++ gnunet/doc/man/Makefile.am  2011-10-26 21:00:53 UTC (rev 17803)
@@ -8,6 +8,7 @@
   gnunet-publish.1 \
   gnunet-search.1 \
   gnunet-statistics.1 \
+  gnunet-transport.1 \
   gnunet-unindex.1 \
   gnunet-monkey.1
 

Modified: gnunet/doc/man/gnunet-directory.1
===================================================================
--- gnunet/doc/man/gnunet-directory.1   2011-10-26 19:27:43 UTC (rev 17802)
+++ gnunet/doc/man/gnunet-directory.1   2011-10-26 21:00:53 UTC (rev 17803)
@@ -1,4 +1,4 @@
-.TH gnunet-directory "1" "10 Dec 2009" "GNUnet"
+.TH gnunet-directory "1" "26 Oct 2011" "GNUnet"
 .SH NAME
 gnunet\-directory \- display directories
 
@@ -32,4 +32,4 @@
 .SH "REPORTING BUGS"
 Report bugs by using mantis <https://gnunet.org/bugs/> or by sending 
electronic mail to <address@hidden>
 .SH "SEE ALSO"
-\fBgnunet\-gtk\fP(1), \fBgnunet\-publish\fP(1), \fBgnunet\-search\fP(1), 
\fBgnunet\-download\fP(1)
+\fBgnunet\-fs\-gtk\fP(1), \fBgnunet\-publish\fP(1), \fBgnunet\-search\fP(1), 
\fBgnunet\-download\fP(1)

Modified: gnunet/doc/man/gnunet-nat-server.1
===================================================================
--- gnunet/doc/man/gnunet-nat-server.1  2011-10-26 19:27:43 UTC (rev 17802)
+++ gnunet/doc/man/gnunet-nat-server.1  2011-10-26 21:00:53 UTC (rev 17803)
@@ -28,8 +28,8 @@
 Use the configuration file FILENAME.
 
 .SH BUGS
-Report bugs by using Mantis <https://gnunet.org/mantis/> or by sending 
electronic mail to <address@hidden>
+Report bugs by using Mantis <https://gnunet.org/bugs/> or by sending 
electronic mail to <address@hidden>
 
 .SH SEE ALSO
-gnunet\-service\-transport(1)
+gnunet\-transport(1)
 

Added: gnunet/doc/man/gnunet-transport.1
===================================================================
--- gnunet/doc/man/gnunet-transport.1                           (rev 0)
+++ gnunet/doc/man/gnunet-transport.1   2011-10-26 21:00:53 UTC (rev 17803)
@@ -0,0 +1,44 @@
+.TH gnunet\-transport "1" "26 Oct 2011" "GNUnet"
+.SH NAME
+gnunet\-transport \- measure and control the transport subsystem
+
+.SH SYNOPSIS
+.B gnunet\-transport
+[\fIOPTIONS\fR]
+.SH DESCRIPTION
+.PP
+
+gnunet\-transport is a tool to access various functions of GNUnet's transport 
subsystem from the command\-line.  Most of these are not expected to be useful 
for end-users.  gnunet\-transport can be used to evaluate the performance of 
the transports, force a peer to connect to another peer (if possible).  Other 
functions should be added in the near future.  
+
+.TP
+\fB\-b\fR, \fB\-\-benchmark\fR
+measure how fast we are receiving data (from all connections).  On exit, the 
data rate will be reported.  Runs until aborted with CTRL-C.
+.TP
+\fB\-c \fIFILENAME\fR, \fB\-\-config=FILENAME\fR
+configuration file to use
+.TP
+\fB\-C \fIPEER\fR, \fB\-\-connect=PEER\fR
+peer to connect to (and to use for sending if used in conjunction with \-s)
+.TP
+\fB\-h\fR, \fB\-\-help\fR
+print help page
+.TP
+\fB\-L \fILOGLEVEL\fR, \fB\-\-loglevel=LOGLEVEL\fR
+Change the loglevel.  Possible values for LOGLEVEL are ERROR, WARNING, INFO 
and DEBUG.
+.TP
+\fB\-s\fR, \fB\-\-send\fR
+transmit (dummy) traffic as quickly as possible to the peer specified with the 
\-C option.  The rate will still be limited by the quota(s) determined by the 
peers (ATS subsystem).  Will run until CTRL\-C is pressed or until the 
connection to the other peer is disrupted.
+.TP
+\fB\-v\fR, \fB\-\-version\fR
+print the version number
+.TP
+\fB\-V\fR, \fB\-\-verbose\fR
+be verbose
+
+.SH NOTES
+
+
+.SH "REPORTING BUGS"
+Report bugs by using mantis <https://gnunet.org/bugs/> or by sending 
electronic mail to <address@hidden>
+.SH "SEE ALSO"
+\fBgnunet\-arm\fP(1)

Modified: gnunet/src/transport/gnunet-transport.c
===================================================================
--- gnunet/src/transport/gnunet-transport.c     2011-10-26 19:27:43 UTC (rev 
17802)
+++ gnunet/src/transport/gnunet-transport.c     2011-10-26 21:00:53 UTC (rev 
17803)
@@ -32,29 +32,69 @@
 #include "gnunet_protocols.h"
 #include "gnunet_transport_service.h"
 
+/**
+ * Which peer should we connect to?
+ */
 static char *cpid;
 
+/**
+ * Handle to transport service.
+ */
 static struct GNUNET_TRANSPORT_Handle *handle;
 
+/**
+ * Option -s.
+ */
 static int benchmark_send;
 
+/**
+ * Option -b.
+ */
 static int benchmark_receive;
 
+/**
+ * Global return value (0 success).
+ */
 static int ret;
 
+/**
+ * Number of bytes of traffic we received so far.
+ */
 static unsigned long long traffic_received;
 
+/**
+ * Number of bytes of traffic we sent so far.
+ */
 static unsigned long long traffic_sent;
 
+/**
+ * Starting time of transmitting/receiving data.
+ */
 static struct GNUNET_TIME_Absolute start_time;
 
+/**
+ * Handle for current transmission request.
+ */
 static struct GNUNET_TRANSPORT_TransmitHandle *th;
 
+/**
+ * Identity of the peer we transmit to / connect to.
+ * (equivalent to 'cpid' string).
+ */
 static struct GNUNET_PeerIdentity pid;
 
+/**
+ * Task scheduled for cleanup / termination of the process.
+ */
 static GNUNET_SCHEDULER_TaskIdentifier end;
 
+/**
+ * Selected level of verbosity.
+ */
+static int verbosity;
 
+
+
 /**
  * Shutdown, print statistics.
  */
@@ -74,7 +114,7 @@
   {
     duration = GNUNET_TIME_absolute_get_duration (start_time);
     fprintf (stderr,
-            "Received %llu bytes/s (%llu bytes in %llu ms)\n",
+            _("Received %llu bytes/s (%llu bytes in %llu ms)\n"),
             1000 * traffic_received / (1+duration.rel_value),
             traffic_received,
             (unsigned long long) duration.rel_value);
@@ -83,7 +123,7 @@
   {
     duration = GNUNET_TIME_absolute_get_duration (start_time);
     fprintf (stderr,
-            "Transmitted %llu bytes/s (%llu bytes in %llu ms)\n",
+            _("Transmitted %llu bytes/s (%llu bytes in %llu ms)\n"),
             1000 * traffic_sent / (1+duration.rel_value),
             traffic_sent,
             (unsigned long long) duration.rel_value);
@@ -120,10 +160,11 @@
                                               0,
                                               GNUNET_TIME_UNIT_FOREVER_REL,
                                               &transmit_data, NULL);
-  fprintf (stderr,
-          "Transmitting %u bytes to %s\n",
-          (unsigned int) size,
-          GNUNET_i2s (&pid));
+  if (verbosity > 0)
+    fprintf (stderr,
+            _("Transmitting %u bytes to %s\n"),
+            (unsigned int) size,
+            GNUNET_i2s (&pid));
   return size;
 }
 
@@ -145,9 +186,10 @@
                GNUNET_ATS_Information
                * ats, uint32_t ats_count)
 {
-  fprintf (stderr,
-          "Connected to %s\n",
-          GNUNET_i2s (peer));
+  if (verbosity > 0)
+    fprintf (stderr,
+            _("Connected to %s\n"),
+            GNUNET_i2s (peer));
   if (0 != memcmp (&pid,
                   peer,
                   sizeof (struct GNUNET_PeerIdentity)))
@@ -185,9 +227,10 @@
                   const struct
                   GNUNET_PeerIdentity * peer)
 {
-  fprintf (stderr,
-          "Disconnected from %s\n",
-          GNUNET_i2s (peer));
+  if (verbosity > 0)
+    fprintf (stderr,
+            _("Disconnected from %s\n"),
+            GNUNET_i2s (peer));
   if ( (0 == memcmp (&pid,
                     peer,
                     sizeof (struct GNUNET_PeerIdentity))) &&
@@ -224,10 +267,11 @@
 {
   if (! benchmark_receive)
     return;
-  fprintf (stderr,
-          "Received %u bytes from %s\n",
-          (unsigned int) ntohs (message->size),
-          GNUNET_i2s (peer));
+  if (verbosity > 0)
+    fprintf (stderr,
+            _("Received %u bytes from %s\n"),
+            (unsigned int) ntohs (message->size),
+            GNUNET_i2s (peer));
   if (traffic_received == 0)
     start_time = GNUNET_TIME_absolute_get ();
   traffic_received += ntohs (message->size);
@@ -300,6 +344,7 @@
     {'s', "send", NULL,
      gettext_noop ("send data for benchmarking to the other peer (until 
CTRL-C)"),
      0, &GNUNET_GETOPT_set_one, &benchmark_send},  
+    GNUNET_GETOPT_OPTION_VERBOSE(&verbosity),
     GNUNET_GETOPT_OPTION_END
   };
   return (GNUNET_OK ==




reply via email to

[Prev in Thread] Current Thread [Next in Thread]