if (i > 255)
memset (value, i - 255, size / 2);
value[0] = crc->i;
- memcpy (&value[4], &i, sizeof (i));
+ GNUNET_memcpy (&value[4], &i, sizeof (i));
prio = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 100);
- crc->api->put (crc->api->cls, &key, size, value, 1 + i % 4 /* type */ ,
- prio, i % 4 /* anonymity */ ,
+ crc->api->put (crc->api->cls,
+ &key,
+ false /* absent */,
+ size,
+ value,
+ 1 + i % 4 /* type */ ,
+ prio,
+ i % 4 /* anonymity */ ,
0 /* replication */ ,
GNUNET_TIME_relative_to_absolute
(GNUNET_TIME_relative_multiply
60 * 60 * 60 * 1000 +
GNUNET_CRYPTO_random_u32
(GNUNET_CRYPTO_QUALITY_WEAK, 1000))),
- put_continuation, crc);
+ put_continuation,
+ crc);
i++;
}
static int
iterate_zeros (void *cls,
- const struct GNUNET_HashCode *key,
- uint32_t size,
+ const struct GNUNET_HashCode *key,
+ uint32_t size,
const void *data,
- enum GNUNET_BLOCK_Type type,
- uint32_t priority,
+ enum GNUNET_BLOCK_Type type,
+ uint32_t priority,
uint32_t anonymity,
- struct GNUNET_TIME_Absolute expiration,
+ uint32_t replication,
+ struct GNUNET_TIME_Absolute expiration,
uint64_t uid)
{
struct CpsRunContext *crc = cls;
GNUNET_assert (key != NULL);
GNUNET_assert (size >= 8);
- memcpy (&i, &cdata[4], sizeof (i));
+ GNUNET_memcpy (&i, &cdata[4], sizeof (i));
hits[i / 8] |= (1 << (i % 8));
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
static int
expiration_get (void *cls,
- const struct GNUNET_HashCode *key,
- uint32_t size,
+ const struct GNUNET_HashCode *key,
+ uint32_t size,
const void *data,
- enum GNUNET_BLOCK_Type type,
+ enum GNUNET_BLOCK_Type type,
uint32_t priority,
- uint32_t anonymity,
+ uint32_t anonymity,
+ uint32_t replication,
struct GNUNET_TIME_Absolute expiration,
- uint64_t uid)
+ uint64_t uid)
{
struct CpsRunContext *crc = cls;
int i;
const char *cdata = data;
GNUNET_assert (size >= 8);
- memcpy (&i, &cdata[4], sizeof (i));
+ GNUNET_memcpy (&i, &cdata[4], sizeof (i));
hits[i / 8] |= (1 << (i % 8));
crc->cnt++;
if (PUT_10 <= crc->cnt)
static int
replication_get (void *cls,
- const struct GNUNET_HashCode *key,
- uint32_t size,
+ const struct GNUNET_HashCode *key,
+ uint32_t size,
const void *data,
- enum GNUNET_BLOCK_Type type,
+ enum GNUNET_BLOCK_Type type,
uint32_t priority,
- uint32_t anonymity,
+ uint32_t anonymity,
+ uint32_t replication,
struct GNUNET_TIME_Absolute expiration,
- uint64_t uid)
+ uint64_t uid)
{
struct CpsRunContext *crc = cls;
int i;
GNUNET_assert (NULL != key);
GNUNET_assert (size >= 8);
- memcpy (&i, &cdata[4], sizeof (i));
+ GNUNET_memcpy (&i, &cdata[4], sizeof (i));
hits[i / 8] |= (1 << (i % 8));
crc->cnt++;
if (PUT_10 <= crc->cnt)