*
* @param cls Closure.
* @param peer Peer towards whom the tunnel is directed.
- * @param channels Number of channels.
- * @param connections Number of connections.
+ * @param n_channels Number of channels.
+ * @param n_connections Number of connections.
+ * @param channels Channels.
+ * @param connections Connections.
* @param estate Encryption state.
* @param cstate Connectivity state.
*/
typedef void (*GNUNET_MESH_TunnelCB) (void *cls,
const struct GNUNET_PeerIdentity *peer,
- unsigned int channels,
- unsigned int connections,
+ unsigned int n_channels,
+ unsigned int n_connections,
+ uint32_t *channels,
+ struct GNUNET_HashCode *connections,
unsigned int estate,
unsigned int cstate);
*
* @param cls Closure.
* @param peer Peer towards whom the tunnel is directed.
- * @param channels Number of channels.
- * @param connections Number of connections.
+ * @param n_channels Number of channels.
+ * @param n_connections Number of connections.
+ * @param channels Channels.
+ * @param connections Connections.
* @param estate Encryption status.
* @param cstate Connectivity status.
*/
void
tunnel_callback (void *cls,
const struct GNUNET_PeerIdentity *peer,
- unsigned int channels,
- unsigned int connections,
+ unsigned int n_channels,
+ unsigned int n_connections,
+ uint32_t *channels,
+ struct GNUNET_HashCode *connections,
unsigned int estate,
unsigned int cstate)
{
if (NULL != peer)
{
FPRINTF (stdout, "Tunnel %s\n", GNUNET_i2s_full (peer));
- FPRINTF (stdout, "- %u channels\n", channels);
- FPRINTF (stdout, "- %u connections\n", connections);
+ FPRINTF (stdout, "- %u channels\n", n_channels);
+ FPRINTF (stdout, "- %u connections\n", n_connections);
FPRINTF (stdout, "- enc state: %u\n", estate);
FPRINTF (stdout, "- con state: %u\n", cstate);
}
size_t msize;
unsigned int ch_n;
unsigned int c_n;
+ struct GNUNET_HashCode *conns;
+ MESH_ChannelNumber *chns;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Get Tunnel messasge received\n");
if (NULL == h->tunnel_cb)
if (esize > msize)
{
GNUNET_break_op (0);
- h->tunnel_cb (h->tunnel_cls, NULL, 0, 0, 0, 0);
+ h->tunnel_cb (h->tunnel_cls, NULL, 0, 0, NULL, NULL, 0, 0);
goto clean_cls;
}
ch_n = ntohl (msg->channels);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "%u (%u ch, %u conn)\n",
sizeof (struct GNUNET_MESH_LocalInfoTunnel),
sizeof (MESH_ChannelNumber), sizeof (struct GNUNET_HashCode));
- h->tunnel_cb (h->tunnel_cls, NULL, 0, 0, 0, 0);
+ h->tunnel_cb (h->tunnel_cls, NULL, 0, 0, NULL, NULL, 0, 0);
goto clean_cls;
}
/* Call Callback with tunnel info. */
+ conns = (struct GNUNET_HashCode *) &msg[1];
+ chns = (MESH_ChannelNumber *) &conns[c_n];
h->tunnel_cb (h->tunnel_cls, &msg->destination,
- ch_n, c_n,
+ ch_n, c_n, chns, conns,
ntohs (msg->estate), ntohs (msg->cstate));
clean_cls: