* @author Bartlomiej Polot
*/
#include "platform.h"
-#include "gnunet_configuration_lib.h"
-#include "gnunet_getopt_lib.h"
+#include "gnunet_util_lib.h"
#include "gnunet_mesh_service.h"
-#include "gnunet_program_lib.h"
/**
* Method called to retrieve information about each tunnel the mesh peer
* is aware of.
*
- * @param cls Closure (unused).
- * @param initiator Peer that started the tunnel (owner).
+ * @param cls Closure.
* @param tunnel_number Tunnel number.
- * @param peers Array of peer identities that participate in the tunnel.
- * @param npeers Number of peers in peers.
+ * @param origin that started the tunnel (owner).
+ * @param target other endpoint of the tunnel
*/
static void
tunnels_callback (void *cls,
- const struct GNUNET_PeerIdentity *initiator,
- unsigned int tunnel_number,
- const struct GNUNET_PeerIdentity *peers,
- unsigned int npeers)
+ uint32_t tunnel_number,
+ const struct GNUNET_PeerIdentity *origin,
+ const struct GNUNET_PeerIdentity *target)
{
- unsigned int i;
-
- fprintf (stdout, "Tunnel %s [%u]: %u peers\n",
- GNUNET_i2s_full (initiator), tunnel_number, npeers);
- for (i = 0; i < npeers; i++)
- fprintf (stdout, " * %s\n", GNUNET_i2s_full (&peers[i]));
+ fprintf (stdout, "Tunnel %s [%u]\n",
+ GNUNET_i2s_full (origin), tunnel_number);
fprintf (stdout, "\n");
}
* @param cls Closure.
* @param peer Peer in the tunnel's tree.
* @param parent Parent of the current peer. All 0 when peer is root.
- *
+ *
*/
static void
tunnel_callback (void *cls,
{
return;
}
- GNUNET_MESH_get_tunnels (mh, &tunnels_callback, NULL);
+// GNUNET_MESH_get_tunnels (mh, &tunnels_callback, NULL);
if (GNUNET_YES != monitor_connections)
{
GNUNET_SCHEDULER_shutdown();
}
}
+
/**
* Call MESH's monitor API, get info of one tunnel.
*
struct GNUNET_PeerIdentity pid;
if (GNUNET_OK !=
- GNUNET_CRYPTO_hash_from_string (tunnel_id, &pid.hashPubKey))
+ GNUNET_CRYPTO_eddsa_public_key_from_string (tunnel_id,
+ strlen (tunnel_id),
+ &pid.public_key))
{
+ fprintf (stderr,
+ _("Invalid tunnel owner `%s'\n"),
+ tunnel_id);
GNUNET_SCHEDULER_shutdown();
return;
}
- GNUNET_MESH_show_tunnel (mh, &pid, 0, tunnel_callback, NULL);
+// GNUNET_MESH_show_tunnel (mh, &pid, 0, tunnel_callback, NULL);
}
static const struct GNUNET_MESH_MessageHandler handlers[] = {
{NULL, 0, 0} /* FIXME add option to monitor msg types */
};
- GNUNET_MESH_ApplicationType apps = 0; /* FIXME add option to monitor apps */
+ /* FIXME add option to monitor apps */
if (args[0] != NULL)
{
}
mh = GNUNET_MESH_connect (cfg,
NULL, /* cls */
- NULL, /* nt */
+ NULL, /* new tunnel */
NULL, /* cleaner */
handlers,
- &apps);
+ NULL);
if (NULL == mh)
GNUNET_SCHEDULER_add_now (shutdown_task, NULL);
else