struct GNUNET_CONTAINER_BloomFilter *bf;
/**
- * Context of our GNUNET_CORE_peer_get_info call.
+ * Context of our GNUNET_CORE_peer_change_preference call.
*/
struct GNUNET_CORE_InformationRequestContext *irc;
*
* @param cls the requests "struct PendingRequest*"
* @param peer identifies the peer
- * @param latency current latency estimate, "FOREVER" if we have been
- * disconnected
* @param bpm_in set to the current bandwidth limit (receiving) for this peer
* @param bpm_out set to the current bandwidth limit (sending) for this peer
* @param amount set to the amount that was actually reserved or unreserved
GNUNET_PeerIdentity * peer,
unsigned int bpm_in,
unsigned int bpm_out,
- struct GNUNET_TIME_Relative
- latency, int amount,
- unsigned long long preference)
+ int amount,
+ uint64_t preference)
{
struct PendingRequest *pr = cls;
uint32_t priority;
}
/* (2) reserve reply bandwidth */
GNUNET_assert (NULL == pr->irc);
- pr->irc = GNUNET_CORE_peer_get_info (sched, cfg,
+ pr->irc = GNUNET_CORE_peer_change_preference (sched, cfg,
&psc.target,
GNUNET_CONSTANTS_SERVICE_TIMEOUT,
-1,
// also, what does the return value mean?
if (pr->irc != NULL)
{
- GNUNET_CORE_peer_get_info_cancel (pr->irc);
+ GNUNET_CORE_peer_change_preference_cancel (pr->irc);
pr->irc = NULL;
}
if (pr->client == NULL)
*
* @param cls closure, not used
* @param peer peer identity this notification is about
+ * @param latency reported latency of the connection with 'other'
+ * @param distance reported distance (DV) to 'other'
*/
static void
peer_connect_handler (void *cls,
const struct
- GNUNET_PeerIdentity * peer)
+ GNUNET_PeerIdentity * peer,
+ struct GNUNET_TIME_Relative latency,
+ uint32_t distance)
{
struct ConnectedPeer *cp;
* @param other the other peer involved (sender or receiver, NULL
* for loopback messages where we are both sender and receiver)
* @param message the actual message
+ * @param latency reported latency of the connection with 'other'
+ * @param distance reported distance (DV) to 'other'
* @return GNUNET_OK to keep the connection open,
* GNUNET_SYSERR to close it (signal serious error)
*/
static int
handle_p2p_get (void *cls,
const struct GNUNET_PeerIdentity *other,
- const struct GNUNET_MessageHeader *message)
+ const struct GNUNET_MessageHeader *message,
+ struct GNUNET_TIME_Relative latency,
+ uint32_t distance)
{
uint16_t msize;
const struct GetMessage *gm;
if (preference < QUERY_BANDWIDTH_VALUE)
preference = QUERY_BANDWIDTH_VALUE;
// FIXME: also reserve bandwidth for reply?
- (void) GNUNET_CORE_peer_get_info (sched, cfg,
- other,
- GNUNET_TIME_UNIT_FOREVER_REL,
- 0, 0, preference, NULL, NULL);
+ (void) GNUNET_CORE_peer_change_preference (sched, cfg,
+ other,
+ GNUNET_TIME_UNIT_FOREVER_REL,
+ 0, 0, preference, NULL, NULL);
if (0 != (pgc->policy & ROUTING_POLICY_ANSWER))
pgc->drq = queue_ds_request (BASIC_DATASTORE_REQUEST_DELAY,
&ds_get_request,
* @param other the other peer involved (sender or receiver, NULL
* for loopback messages where we are both sender and receiver)
* @param message the actual message
+ * @param latency reported latency of the connection with 'other'
+ * @param distance reported distance (DV) to 'other'
* @return GNUNET_OK to keep the connection open,
* GNUNET_SYSERR to close it (signal serious error)
*/
static int
handle_p2p_put (void *cls,
const struct GNUNET_PeerIdentity *other,
- const struct GNUNET_MessageHeader *message)
+ const struct GNUNET_MessageHeader *message,
+ struct GNUNET_TIME_Relative latency,
+ uint32_t distance)
{
const struct PutMessage *put;
uint16_t msize;
* has completed.
*
* @param cls our 'struct DisconnectList'
- * @param peer NULL on error (then what?)
- * @param bpm_in set to the current bandwidth limit (receiving) for this peer
- * @param bpm_out set to the current bandwidth limit (sending) for this peer
- * @param latency current latency estimate, "FOREVER" if we have been
- * disconnected
- * @param amount set to the amount that was actually reserved or unreserved
- * @param preference current traffic preference for the given peer
+ * @param tc unused
*/
static void
disconnect_done (void *cls,
- const struct
- GNUNET_PeerIdentity * peer,
- unsigned int bpm_in,
- unsigned int bpm_out,
- struct GNUNET_TIME_Relative
- latency, int amount,
- unsigned long long preference)
+ const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct DisconnectList *dl = cls;
*
* @param cls closure
* @param peer peer identity this notification is about
+ * @param latency reported latency of the connection with 'other'
+ * @param distance reported distance (DV) to 'other'
*/
static void
connect_notify (void *cls,
const struct
- GNUNET_PeerIdentity * peer)
+ GNUNET_PeerIdentity * peer,
+ struct GNUNET_TIME_Relative latency,
+ uint32_t distance)
{
struct PeerList *pos;
* @param other the other peer involved (sender or receiver, NULL
* for loopback messages where we are both sender and receiver)
* @param message the actual HELLO message
+ * @param latency reported latency of the connection with 'other'
+ * @param distance reported distance (DV) to 'other'
* @return GNUNET_OK to keep the connection open,
* GNUNET_SYSERR to close it (signal serious error)
*/
handle_encrypted_hello (void *cls,
const struct GNUNET_PeerIdentity * other,
const struct GNUNET_MessageHeader *
- message)
+ message,
+ struct GNUNET_TIME_Relative latency,
+ uint32_t distance)
{
#if DEBUG_TOPOLOGY
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
GNUNET_CONTAINER_DLL_remove (disconnect_head,
disconnect_tail,
dl);
- GNUNET_CORE_peer_get_info_cancel (dl->rh);
+ GNUNET_CORE_peer_request_cancel (dl->rh);
GNUNET_free (dl);
}
}