[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r31131 - gnunet/src/mesh
From: |
gnunet |
Subject: |
[GNUnet-SVN] r31131 - gnunet/src/mesh |
Date: |
Fri, 6 Dec 2013 03:28:17 +0100 |
Author: bartpolot
Date: 2013-12-06 03:28:17 +0100 (Fri, 06 Dec 2013)
New Revision: 31131
Modified:
gnunet/src/mesh/gnunet-mesh.c
gnunet/src/mesh/gnunet-service-mesh_channel.c
Log:
-wip
Modified: gnunet/src/mesh/gnunet-mesh.c
===================================================================
--- gnunet/src/mesh/gnunet-mesh.c 2013-12-05 22:58:48 UTC (rev 31130)
+++ gnunet/src/mesh/gnunet-mesh.c 2013-12-06 02:28:17 UTC (rev 31131)
@@ -34,11 +34,41 @@
static int monitor_connections;
/**
- * Option -t
+ * Option -i.
*/
+static int get_info;
+
+/**
+ * Option --tunnel
+ */
static char *tunnel_id;
/**
+ * Option --connection
+ */
+static char *conn_id;
+
+/**
+ * Option --channel
+ */
+static char *channel_id;
+
+/**
+ * Port to listen on (-p).
+ */
+static uint32_t listen_port;
+
+/**
+ * Peer to connect to.
+ */
+static char *target_id;
+
+/**
+ * Port to connect to
+ */
+static uint32_t target_port;
+
+/**
* Mesh handle.
*/
static struct GNUNET_MESH_Handle *mh;
@@ -168,10 +198,22 @@
{NULL, 0, 0} /* FIXME add option to monitor msg types */
};
/* FIXME add option to monitor apps */
+ int i;
+ for (i = 0; args[i]; i++)
+ {
+ FPRINTF (stderr, "Parameter %u `%s'\n", i, args[i]);
+ }
- if (args[0] != NULL)
+ target_id = args[0];
+ target_port = args[0] && args[1] ? atoi(args[1]) : 0;
+ if ( (0 != get_info
+ || 0 != monitor_connections
+ || NULL != tunnel_id
+ || NULL != conn_id
+ || NULL != channel_id)
+ && target_id != NULL)
{
- FPRINTF (stderr, _("Invalid command line argument `%s'\n"), args[0]);
+ FPRINTF (stderr, _("You must NOT give a TARGET when using options\n"));
return;
}
mh = GNUNET_MESH_connect (cfg,
@@ -208,18 +250,30 @@
{'m', "monitor", NULL,
gettext_noop ("provide information about all tunnels (continuously) NOT
IMPLEMENTED"), /* FIXME */
GNUNET_NO, &GNUNET_GETOPT_set_one, &monitor_connections},
- {'t', "tunnel", "OWNER_ID:TUNNEL_ID",
+ {'i', "info", NULL,
+ gettext_noop ("provide information about all tunnels"),
+ GNUNET_NO, &GNUNET_GETOPT_set_one, &get_info},
+ {'p', "port", NULL,
+ gettext_noop ("listen on this port"),
+ GNUNET_NO, &GNUNET_GETOPT_set_uint, &listen_port},
+ {'t', "tunnel", "TUNNEL_ID",
gettext_noop ("provide information about a particular tunnel"),
GNUNET_YES, &GNUNET_GETOPT_set_string, &tunnel_id},
+ {'n', "connection", "TUNNEL_ID:CONNECTION_ID",
+ gettext_noop ("provide information about a particular connection"),
+ GNUNET_YES, &GNUNET_GETOPT_set_string, &conn_id},
+ {'a', "channel", "TUNNEL_ID:CHANNEL_ID",
+ gettext_noop ("provide information about a particular channel"),
+ GNUNET_YES, &GNUNET_GETOPT_set_string, &channel_id},
GNUNET_GETOPT_OPTION_END
};
if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
return 2;
- res = GNUNET_PROGRAM_run (argc, argv, "gnunet-mesh",
+ res = GNUNET_PROGRAM_run (argc, argv, "gnunet-mesh (OPTIONS | TARGET PORT)",
gettext_noop
- ("Print information about mesh tunnels and peers."),
+ ("Create channels and retreive info about meshs
status."),
options, &run, NULL);
GNUNET_free ((void *) argv);
Modified: gnunet/src/mesh/gnunet-service-mesh_channel.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_channel.c 2013-12-05 22:58:48 UTC
(rev 31130)
+++ gnunet/src/mesh/gnunet-service-mesh_channel.c 2013-12-06 02:28:17 UTC
(rev 31131)
@@ -796,7 +796,7 @@
/**
- * Confirm we got a channel create, FWD ack.
+ * Confirm we got a channel create or FWD ack.
*
* @param ch The channel to confirm.
* @param fwd Should we send a FWD ACK? (going dest->root)
@@ -818,7 +818,7 @@
/**
- * Sent a message and don't keep any info about it: we won't need to cancel it
+ * Send a message and don't keep any info about it: we won't need to cancel it
* or resend it.
*
* @param msg Header of the message to fire away.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r31131 - gnunet/src/mesh,
gnunet <=