- unsigned int i;
- struct GNUNET_MessageHeader *msg;
- char buf[MTU + 32 * 1024];
-
- defrag = GNUNET_DEFRAGMENT_context_create (NULL, MTU, NUM_MSGS /* enough space for all */
- , NULL, &proc_msgs, &proc_acks);
- for (i = 0; i < sizeof (buf); i++)
- buf[i] = (char) i;
- msg = (struct GNUNET_MessageHeader *) buf;
- for (i = 0; i < NUM_MSGS; i++)
- {
- msg->type = htons ((uint16_t) i);
- msg->size =
- htons (sizeof (struct GNUNET_MessageHeader) + (17 * i) % (32 * 1024));
- frags[i] = GNUNET_FRAGMENT_context_create (NULL /* no stats */ ,
- MTU, &trackers[i],
- GNUNET_TIME_UNIT_MILLISECONDS,
- GNUNET_TIME_UNIT_SECONDS,
- msg,
- &proc_frac, &frags[i]);
- }