+ static struct GNUNET_DHT_PutMessage put_message;
+ static struct DHT_MessageContext message_context;
+ static GNUNET_HashCode key;
+ unsigned int mcsize;
+ uint32_t random_key;
+ put_message.header.size = htons(sizeof(struct GNUNET_DHT_GetMessage));
+ put_message.header.type = htons(GNUNET_MESSAGE_TYPE_DHT_PUT);
+ put_message.type = htons(DHT_MALICIOUS_MESSAGE_TYPE);
+ put_message.expiration = GNUNET_TIME_absolute_hton(GNUNET_TIME_absolute_get_forever());
+ mcsize = sizeof(struct DHT_MessageContext) + sizeof(GNUNET_HashCode);
+ memset(&message_context, 0, sizeof(struct DHT_MessageContext));
+ message_context.client = NULL;
+ random_key = GNUNET_CRYPTO_random_u32(GNUNET_CRYPTO_QUALITY_WEAK, (uint32_t)-1);
+ GNUNET_CRYPTO_hash(&random_key, sizeof(uint32_t), &key);
+ message_context.key = &key;
+ message_context.unique_id = GNUNET_ntohll (GNUNET_CRYPTO_random_u64(GNUNET_CRYPTO_QUALITY_WEAK, (uint64_t)-1));
+ message_context.replication = ntohl (DHT_DEFAULT_FIND_PEER_REPLICATION);
+ message_context.msg_options = ntohl (0);
+ message_context.network_size = estimate_diameter();
+ message_context.peer = &my_identity;
+ increment_stats(STAT_PUT_START);
+ GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "%s:%s Sending malicious PUT message with hash %s", my_short_id, "DHT", GNUNET_h2s(&key));
+ route_message(NULL, &put_message.header, &message_context);
+ GNUNET_SCHEDULER_add_delayed(sched, GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MILLISECONDS, malicious_put_frequency), &malicious_put_task, NULL);
+