Lines Matching full:flip
228 int *should_drop, uint16_t *flip, size_t *flip_offset) in get_noise() argument
232 *flip = 0; in get_noise()
243 * Of noisy datagrams, 25% drop, 25% duplicate, 25% delay, 25% flip bits in get_noise()
267 /* flip some bits in the header */ in get_noise()
269 /* we flip at most 8 bits of the 16 bit value at once */ in get_noise()
270 *flip = (test_random() % 255 + 1) << (test_random() % 8); in get_noise()
279 static void flip_bits(unsigned char *msg, size_t msg_len, uint16_t flip, in flip_bits() argument
282 if (flip == 0) in flip_bits()
298 msg[flip_offset] ^= flip >> 8; in flip_bits()
299 msg[flip_offset + 1] ^= flip & 0xff; in flip_bits()
366 uint16_t flip = 0; in noisy_dgram_recvmmsg() local
394 &reinject, &should_drop, &flip, &flip_offset); in noisy_dgram_recvmmsg()
409 flip = 0; in noisy_dgram_recvmmsg()
413 flip_bits(thismsg->data, thismsg->data_len, flip, flip_offset); in noisy_dgram_recvmmsg()