Lines Matching refs:data

54             struct noisy_dgram_st *data;  in noisy_dgram_ctrl()  local
56 data = BIO_get_data(bio); in noisy_dgram_ctrl()
57 if (!TEST_ptr(data)) in noisy_dgram_ctrl()
59 data->backoff = 1; in noisy_dgram_ctrl()
64 struct noisy_dgram_st *data; in noisy_dgram_ctrl() local
66 data = BIO_get_data(bio); in noisy_dgram_ctrl()
67 if (!TEST_ptr(data)) in noisy_dgram_ctrl()
69 data->noise_rate = (int)num; in noisy_dgram_ctrl()
74 struct noisy_dgram_st *data; in noisy_dgram_ctrl() local
76 data = BIO_get_data(bio); in noisy_dgram_ctrl()
77 if (!TEST_ptr(data)) in noisy_dgram_ctrl()
79 data->recv_limit.bw = (size_t)num; in noisy_dgram_ctrl()
84 struct noisy_dgram_st *data; in noisy_dgram_ctrl() local
86 data = BIO_get_data(bio); in noisy_dgram_ctrl()
87 if (!TEST_ptr(data)) in noisy_dgram_ctrl()
89 data->send_limit.bw = (size_t)num; in noisy_dgram_ctrl()
94 struct noisy_dgram_st *data; in noisy_dgram_ctrl() local
97 data = BIO_get_data(bio); in noisy_dgram_ctrl()
98 if (!TEST_ptr(data)) in noisy_dgram_ctrl()
100 data->now_cb = now_cb->now_cb; in noisy_dgram_ctrl()
101 data->now_cb_arg = now_cb->now_cb_arg; in noisy_dgram_ctrl()
174 struct noisy_dgram_st *data; in noisy_dgram_sendmmsg() local
180 data = BIO_get_data(bio); in noisy_dgram_sendmmsg()
181 if (!TEST_ptr(data)) in noisy_dgram_sendmmsg()
184 now = data->now_cb != NULL ? data->now_cb(data->now_cb_arg) in noisy_dgram_sendmmsg()
188 num_msg = bandwidth_limit(&data->send_limit, now, msg, num_msg); in noisy_dgram_sendmmsg()
309 struct noisy_dgram_st *data; in noisy_dgram_recvmmsg() local
315 data = BIO_get_data(bio); in noisy_dgram_recvmmsg()
316 if (!TEST_ptr(data)) in noisy_dgram_recvmmsg()
343 BIO_dump_fp(stdout, msg[i].data, msg[i].data_len); in noisy_dgram_recvmmsg()
349 now = data->now_cb != NULL ? data->now_cb(data->now_cb_arg) in noisy_dgram_recvmmsg()
353 msg_cnt = bandwidth_limit(&data->recv_limit, now, msg, msg_cnt); in noisy_dgram_recvmmsg()
357 if (data->noise_rate == 0) in noisy_dgram_recvmmsg()
363 i++, thismsg++, data->this_dgram++) { in noisy_dgram_recvmmsg()
370 if (data->reinject_dgram > 0 in noisy_dgram_recvmmsg()
371 && data->reinject_dgram == data->this_dgram) { in noisy_dgram_recvmmsg()
378 if (!bio_msg_copy(thismsg, &data->msg)) in noisy_dgram_recvmmsg()
381 data->reinject_dgram = 0; in noisy_dgram_recvmmsg()
384 BIO_dump_fp(stdout, thismsg->data, thismsg->data_len); in noisy_dgram_recvmmsg()
389 data->reinject_dgram = 0; in noisy_dgram_recvmmsg()
392 get_noise(data->noise_rate, in noisy_dgram_recvmmsg()
393 /* long header */ (((uint8_t *)thismsg->data)[0] & 0x80) != 0, in noisy_dgram_recvmmsg()
395 if (data->backoff) { in noisy_dgram_recvmmsg()
408 data->backoff = 0; in noisy_dgram_recvmmsg()
411 flip_bits(thismsg->data, thismsg->data_len, flip, flip_offset); in noisy_dgram_recvmmsg()
417 if (reinject > 0 && data->reinject_dgram == 0) { in noisy_dgram_recvmmsg()
424 if (!bio_msg_copy(&data->msg, thismsg)) in noisy_dgram_recvmmsg()
427 data->reinject_dgram = data->this_dgram + reinject; in noisy_dgram_recvmmsg()
432 BIO_dump_fp(stdout, thismsg->data, thismsg->data_len); in noisy_dgram_recvmmsg()
440 BIO_dump_fp(stdout, thismsg->data, thismsg->data_len); in noisy_dgram_recvmmsg()
455 BIO_dump_fp(stdout, msg[i].data, msg[i].data_len); in noisy_dgram_recvmmsg()
472 static void data_free(struct noisy_dgram_st *data) in data_free() argument
474 if (data == NULL) in data_free()
477 OPENSSL_free(data->msg.data); in data_free()
478 BIO_ADDR_free(data->msg.peer); in data_free()
479 BIO_ADDR_free(data->msg.local); in data_free()
480 OPENSSL_free(data); in data_free()
485 struct noisy_dgram_st *data = OPENSSL_zalloc(sizeof(*data)); in noisy_dgram_new() local
487 if (!TEST_ptr(data)) in noisy_dgram_new()
490 data->noise_rate = NOISE_RATE; in noisy_dgram_new()
491 data->msg.data = OPENSSL_malloc(MSG_DATA_LEN_MAX); in noisy_dgram_new()
492 data->msg.peer = BIO_ADDR_new(); in noisy_dgram_new()
493 data->msg.local = BIO_ADDR_new(); in noisy_dgram_new()
494 if (data->msg.data == NULL in noisy_dgram_new()
495 || data->msg.peer == NULL in noisy_dgram_new()
496 || data->msg.local == NULL) { in noisy_dgram_new()
497 data_free(data); in noisy_dgram_new()
501 BIO_set_data(bio, data); in noisy_dgram_new()