* Function to call whenever we're notified about a peer connecting
* (pre-connects, no session key exchange yet).
*/
- GNUNET_CORE_ClientEventHandler pre_connects;
+ GNUNET_CORE_ConnectEventHandler pre_connects;
/**
* Function to call whenever we're notified about a peer connecting.
*/
- GNUNET_CORE_ClientEventHandler connects;
+ GNUNET_CORE_ConnectEventHandler connects;
/**
* Function to call whenever we're notified about a peer disconnecting.
*/
- GNUNET_CORE_ClientEventHandler disconnects;
+ GNUNET_CORE_DisconnectEventHandler disconnects;
/**
* Function to call whenever we receive an inbound message.
}
cnm = (const struct ConnectNotifyMessage *) msg;
h->pre_connects (h->cls,
- &cnm->peer);
+ &cnm->peer,
+ GNUNET_TIME_relative_ntoh (cnm->latency),
+ ntohl (cnm->distance));
break;
case GNUNET_MESSAGE_TYPE_CORE_NOTIFY_CONNECT:
if (NULL == h->connects)
}
cnm = (const struct ConnectNotifyMessage *) msg;
h->connects (h->cls,
- &cnm->peer);
+ &cnm->peer,
+ GNUNET_TIME_relative_ntoh (cnm->latency),
+ ntohl (cnm->distance));
break;
case GNUNET_MESSAGE_TYPE_CORE_NOTIFY_DISCONNECT:
if (NULL == h->disconnects)
continue;
}
if (GNUNET_OK !=
- h->handlers[hpos].callback (h->cls, &ntm->peer, em))
+ h->handlers[hpos].callback (h->cls, &ntm->peer, em,
+ GNUNET_TIME_relative_ntoh (ntm->latency),
+ ntohl (ntm->distance)))
{
/* error in processing, disconnect ! */
reconnect (h);
}
}
if (NULL != h->inbound_notify)
- h->inbound_notify (h->cls, &ntm->peer, em);
+ h->inbound_notify (h->cls, &ntm->peer, em,
+ GNUNET_TIME_relative_ntoh (ntm->latency),
+ ntohl (ntm->distance));
break;
case GNUNET_MESSAGE_TYPE_CORE_NOTIFY_OUTBOUND:
if (msize <
GNUNET_break (0);
break;
}
- h->outbound_notify (h->cls, &ntm->peer, em);
+ h->outbound_notify (h->cls, &ntm->peer, em,
+ GNUNET_TIME_relative_ntoh (ntm->latency),
+ ntohl (ntm->distance));
break;
case GNUNET_MESSAGE_TYPE_CORE_CONFIGURATION_INFO:
if (msize != sizeof (struct ConfigurationInfoMessage))
&h->submitted->peer,
ntohl (cim->bpm_in),
ntohl (cim->bpm_out),
- GNUNET_TIME_relative_ntoh (cim->latency),
(int) ntohl (cim->reserved_amount),
cim->preference);
/* done, clean up! */
struct GNUNET_TIME_Relative timeout,
void *cls,
GNUNET_CORE_StartupCallback init,
- GNUNET_CORE_ClientEventHandler pre_connects,
- GNUNET_CORE_ClientEventHandler connects,
- GNUNET_CORE_ClientEventHandler disconnects,
+ GNUNET_CORE_ConnectEventHandler pre_connects,
+ GNUNET_CORE_ConnectEventHandler connects,
+ GNUNET_CORE_DisconnectEventHandler disconnects,
GNUNET_CORE_MessageCallback inbound_notify,
int inbound_hdr_only,
GNUNET_CORE_MessageCallback outbound_notify,