* first field after header (this is where we start to encrypt!).
*/
uint32_t challenge GNUNET_PACKED;
-
+
/**
- * Desired bandwidth (how much we should send to this
- * peer / how much is the sender willing to receive).
+ * Reserved, always 'GNUNET_BANDWIDTH_VALUE_MAX'.
*/
- struct GNUNET_BANDWIDTH_Value32NBO inbound_bw_limit;
+ struct GNUNET_BANDWIDTH_Value32NBO reserved;
/**
* Intended target of the PING, used primarily to check
uint32_t sequence_number GNUNET_PACKED;
/**
- * Desired bandwidth (how much we should send to this peer / how
- * much is the sender willing to receive)?
+ * Reserved, always 'GNUNET_BANDWIDTH_VALUE_MAX'.
*/
- struct GNUNET_BANDWIDTH_Value32NBO inbound_bw_limit;
+ struct GNUNET_BANDWIDTH_Value32NBO reserved;
/**
* Timestamp. Used to prevent reply of ancient messages
return;
}
/* construct PONG */
- tx.inbound_bw_limit = GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT;
+ tx.reserved = GNUNET_BANDWIDTH_VALUE_MAX;
/* FIXME: here we should ideally ask ATS about unassigned bandwidth and fill in
a value based on that; using the minimum here results in a rather slow start... */
tx.challenge = t.challenge;
kx->retry_set_key_task = GNUNET_SCHEDULER_NO_TASK;
GNUNET_assert (kx->keep_alive_task == GNUNET_SCHEDULER_NO_TASK);
update_timeout (kx);
- GSC_SESSIONS_update (&kx->peer,
- t.inbound_bw_limit);
break;
case KX_STATE_UP:
update_timeout (kx);
- GSC_SESSIONS_update (&kx->peer,
- t.inbound_bw_limit);
break;
default:
GNUNET_break (0);
* Encrypt and transmit a message with the given payload.
*
* @param kx key exchange context
- * @param bw_in bandwidth limit to transmit to the other peer;
- * the other peer shall not send us more than the
- * given rate
* @param payload payload of the message
* @param payload_size number of bytes in 'payload'
*/
void
GSC_KX_encrypt_and_transmit (struct GSC_KeyExchangeInfo *kx,
- struct GNUNET_BANDWIDTH_Value32NBO bw_in,
const void *payload,
size_t payload_size)
{
struct GNUNET_CRYPTO_AesInitializationVector iv;
struct GNUNET_CRYPTO_AuthKey auth_key;
-#if DEBUG_CORE_QUOTA
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Sending %u b/s as new limit to peer `%4s'\n",
- (unsigned int) ntohl (bw_in.value__),
- GNUNET_i2s (&kx->peer));
-#endif
ph = (struct EncryptedMessage*) pbuf;
ph->iv_seed =
htonl (GNUNET_CRYPTO_random_u32
(GNUNET_CRYPTO_QUALITY_NONCE, UINT32_MAX));
ph->sequence_number = htonl (++kx->last_sequence_number_sent);
- ph->inbound_bw_limit = bw_in;
+ ph->reserved = GNUNET_BANDWIDTH_VALUE_MAX;
ph->timestamp = GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get ());
memcpy (&ph[1], payload, payload_size);
/* process decrypted message(s) */
update_timeout (kx);
- GSC_SESSIONS_update (&kx->peer,
- pt->inbound_bw_limit);
GNUNET_STATISTICS_update (GSC_stats,
gettext_noop ("# bytes of payload decrypted"),
size - sizeof (struct EncryptedMessage), GNUNET_NO);
*/
GNUNET_SCHEDULER_TaskIdentifier cork_task;
- /**
- * Available bandwidth out for this peer (current target). This
- * value should be the 'MIN' of 'bw_out_internal_limit' and
- * 'bw_out_external_limit'.
- */
- struct GNUNET_BANDWIDTH_Value32NBO bw_out;
-
- /**
- * Internal bandwidth limit set for this peer (initially typically
- * set to "MAX_INT"). Actual "bw_out" is MIN of
- * "bpm_out_internal_limit" and "bw_out_external_limit".
- *
- *
- *
- * // FIXME: check usage
- */
- struct GNUNET_BANDWIDTH_Value32NBO bw_out_internal_limit;
-
- /**
- * External bandwidth limit set for this peer by the
- * peer that we are communicating with. "bw_out" is MIN of
- * "bw_out_internal_limit" and "bw_out_external_limit".
- * // FIXME: check usage
- */
- struct GNUNET_BANDWIDTH_Value32NBO bw_out_external_limit;
-
-
/**
* Is the neighbour queue empty and thus ready for us
* to transmit an encrypted message?
gettext_noop ("# established sessions"),
GNUNET_CONTAINER_multihashmap_size (sessions),
GNUNET_NO);
-#if 0
- /* FIXME: integration with ATS for quota calculations... */
- /* FIXME: who should do this? Neighbours!? */
- GNUNET_TRANSPORT_set_quota (transport,
- peer,
- GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT,
- GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT);
-#endif
/* FIXME: we should probably do this periodically (in case
type map message is lost...) */
hdr = GSC_TYPEMAP_compute_type_map_message ();
GSC_KX_encrypt_and_transmit (kx,
- GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT,
hdr,
ntohs (hdr->size));
GNUNET_free (hdr);
/* now actually transmit... */
session->ready_to_transmit = GNUNET_NO;
GSC_KX_encrypt_and_transmit (session->kxinfo,
- GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT /* FIXME! */,
pbuf,
used);
}
}
-/**
- * Update information about a session.
- *
- * @param peer peer who's session should be updated
- * @param bw_out new outbound bandwidth limit for the peer
- * @param atsi performance information
- * @param atsi_count number of performance records supplied
- */
-void
-GSC_SESSIONS_update (const struct GNUNET_PeerIdentity *peer,
- struct GNUNET_BANDWIDTH_Value32NBO bw_out)
-{
- // FIXME
- /* not implemented */
-}
-
-
/**
* Initialize sessions subsystem.
*/