Lines Matching refs:opt
165 } opt; variable
184 opt.server_addr = DFL_SERVER_ADDR; in get_options()
185 opt.server_port = DFL_SERVER_PORT; in get_options()
186 opt.listen_addr = DFL_LISTEN_ADDR; in get_options()
187 opt.listen_port = DFL_LISTEN_PORT; in get_options()
188 opt.pack = DFL_PACK; in get_options()
191 opt.delay_cli_cnt = 0; in get_options()
192 opt.delay_srv_cnt = 0; in get_options()
193 memset(opt.delay_cli, 0, sizeof(opt.delay_cli)); in get_options()
194 memset(opt.delay_srv, 0, sizeof(opt.delay_srv)); in get_options()
204 opt.server_addr = q; in get_options()
206 opt.server_port = q; in get_options()
208 opt.listen_addr = q; in get_options()
210 opt.listen_port = q; in get_options()
212 opt.duplicate = atoi(q); in get_options()
213 if (opt.duplicate < 0 || opt.duplicate > 20) { in get_options()
217 opt.delay = atoi(q); in get_options()
218 if (opt.delay < 0 || opt.delay > 20 || opt.delay == 1) { in get_options()
222 opt.delay_ccs = atoi(q); in get_options()
223 if (opt.delay_ccs < 0 || opt.delay_ccs > 1) { in get_options()
234 delay_cnt = &opt.delay_cli_cnt; in get_options()
235 delay_list = opt.delay_cli; in get_options()
237 delay_cnt = &opt.delay_srv_cnt; in get_options()
238 delay_list = opt.delay_srv; in get_options()
257 opt.drop = atoi(q); in get_options()
258 if (opt.drop < 0 || opt.drop > 20 || opt.drop == 1) { in get_options()
263 opt.pack = (unsigned) atoi(q); in get_options()
269 opt.mtu = atoi(q); in get_options()
270 if (opt.mtu < 0 || opt.mtu > MAX_MSG_SIZE) { in get_options()
274 opt.bad_ad = atoi(q); in get_options()
275 if (opt.bad_ad < 0 || opt.bad_ad > 1) { in get_options()
281 opt.bad_cid = (unsigned) atoi(q); in get_options()
285 opt.protect_hvr = atoi(q); in get_options()
286 if (opt.protect_hvr < 0 || opt.protect_hvr > 1) { in get_options()
290 opt.protect_len = atoi(q); in get_options()
291 if (opt.protect_len < 0) { in get_options()
295 opt.inject_clihlo = atoi(q); in get_options()
296 if (opt.inject_clihlo < 0 || opt.inject_clihlo > 1) { in get_options()
300 opt.seed = atoi(q); in get_options()
301 if (opt.seed == 0) { in get_options()
410 if (cur_time - buf->packet_lifetime >= opt.pack) { in ctx_buffer_time_remaining()
414 return opt.pack - (cur_time - buf->packet_lifetime); in ctx_buffer_time_remaining()
458 if (opt.pack > 0) { in dispatch_data()
539 if (opt.inject_clihlo != 0 && in send_packet()
547 if (opt.bad_cid != 0 && in send_packet()
549 (rand() % opt.bad_cid) == 0) { in send_packet()
564 if (opt.bad_ad && in send_packet()
589 if (opt.duplicate != 0 && in send_packet()
591 rand() % opt.duplicate == 0) { in send_packet()
601 if (opt.inject_clihlo != 0 && in send_packet()
696 delay_list = opt.delay_cli; in handle_message()
697 delay_list_len = opt.delay_cli_cnt; in handle_message()
699 delay_list = opt.delay_srv; in handle_message()
700 delay_list_len = opt.delay_srv_cnt; in handle_message()
723 if ((opt.mtu != 0 && in handle_message()
724 cur.len > (unsigned) opt.mtu) || in handle_message()
725 (opt.drop != 0 && in handle_message()
728 !(opt.protect_hvr && in handle_message()
730 cur.len != (size_t) opt.protect_len && in handle_message()
732 rand() % opt.drop == 0)) { in handle_message()
734 } else if ((opt.delay_ccs == 1 && in handle_message()
736 (opt.delay != 0 && in handle_message()
739 !(opt.protect_hvr && in handle_message()
741 cur.len != (size_t) opt.protect_len && in handle_message()
743 rand() % opt.delay == 0)) { in handle_message()
793 if (opt.seed == 0) { in main()
795 opt.seed = (unsigned int) mbedtls_time(NULL); in main()
797 opt.seed = 1; in main()
799 mbedtls_printf(" . Pseudo-random seed: %u\n", opt.seed); in main()
802 srand(opt.seed); in main()
808 opt.server_addr, opt.server_port); in main()
811 if ((ret = mbedtls_net_connect(&server_fd, opt.server_addr, opt.server_port, in main()
823 opt.listen_addr, opt.listen_port); in main()
826 if ((ret = mbedtls_net_bind(&listen_fd, opt.listen_addr, opt.listen_port, in main()
867 if (opt.pack > 0) { in main()
882 if (opt.pack > 0) { in main()
956 mbedtls_free(opt.delay_cli[delay_idx]); in main()
957 mbedtls_free(opt.delay_srv[delay_idx]); in main()