GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 2, or (at your
+ by the Free Software Foundation; either version 3, or (at your
option) any later version.
GNUnet is distributed in the hope that it will be useful, but
/**
* @file core/core_api_peer_get_info.c
- * @brief implementation of the peer_get_info functions
+ * @brief implementation of the peer_change_preference functions
* @author Christian Grothoff
*/
#include "platform.h"
{
struct GNUNET_CORE_InformationRequestContext *irc = cls;
const struct ConfigurationInfoMessage *cim;
+ static struct GNUNET_BANDWIDTH_Value32NBO zbw; /* zero bandwidth */
if (msg == NULL)
{
if (irc->info != NULL)
irc->info (irc->info_cls,
- NULL, 0, 0, 0, 0);
- GNUNET_CLIENT_disconnect (irc->client);
+ NULL, zbw, zbw, 0, 0);
+ GNUNET_CLIENT_disconnect (irc->client, GNUNET_NO);
GNUNET_free (irc);
return;
}
GNUNET_break (0);
if (irc->info != NULL)
irc->info (irc->info_cls,
- NULL, 0, 0, GNUNET_TIME_UNIT_FOREVER_REL, 0, 0);
- GNUNET_CLIENT_disconnect (irc->client);
+ NULL, zbw, zbw, 0, 0);
+ GNUNET_CLIENT_disconnect (irc->client, GNUNET_NO);
GNUNET_free (irc);
return;
}
if (irc->info != NULL)
irc->info (irc->info_cls,
&cim->peer,
- ntohl (cim->bpm_in),
- ntohl (cim->bpm_out),
+ cim->bw_in,
+ cim->bw_out,
ntohl (cim->reserved_amount),
GNUNET_ntohll (cim->preference));
- GNUNET_CLIENT_disconnect (irc->client);
+ GNUNET_CLIENT_disconnect (irc->client, GNUNET_NO);
GNUNET_free (irc);
}
* @param peer identifies the peer
* @param timeout after how long should we give up (and call "info" with NULL
* for "peer" to signal an error)?
- * @param bpm_out set to the current bandwidth limit (sending) for this peer,
- * caller should set "bpm_out" to "-1" to avoid changing
- * the current value; otherwise "bpm_out" will be lowered to
+ * @param bw_out set to the current bandwidth limit (sending) for this peer,
+ * caller should set "bw_out" to "-1" to avoid changing
+ * the current value; otherwise "bw_out" will be lowered to
* the specified value; passing a pointer to "0" can be used to force
- * us to disconnect from the peer; "bpm_out" might not increase
+ * us to disconnect from the peer; "bw_out" might not increase
* as specified since the upper bound is generally
* determined by the other peer!
* @param amount reserve N bytes for receiving, negative
const struct GNUNET_CONFIGURATION_Handle *cfg,
const struct GNUNET_PeerIdentity *peer,
struct GNUNET_TIME_Relative timeout,
- uint32_t bpm_out,
+ struct GNUNET_BANDWIDTH_Value32NBO bw_out,
int32_t amount,
uint64_t preference,
GNUNET_CORE_PeerConfigurationInfoCallback info,
rim.header.size = htons (sizeof (struct RequestInfoMessage));
rim.header.type = htons (GNUNET_MESSAGE_TYPE_CORE_REQUEST_INFO);
rim.reserved = htonl (0);
- rim.limit_outbound_bpm = htonl (bpm_out);
+ rim.limit_outbound = bw_out;
rim.reserve_inbound = htonl (amount);
rim.preference_change = GNUNET_htonll(preference);
rim.peer = *peer;
* @param irc context returned by the original GNUNET_CORE_peer_get_info call
*/
void
-GNUNET_CORE_peer_get_info_cancel (struct GNUNET_CORE_InformationRequestContext *irc)
+GNUNET_CORE_peer_change_preference_cancel (struct GNUNET_CORE_InformationRequestContext *irc)
{
- GNUNET_CLIENT_disconnect (irc->client);
+ GNUNET_CLIENT_disconnect (irc->client, GNUNET_NO);
GNUNET_free (irc);
}