Lines Matching refs:opt

162 } opt;  variable
181 opt.server_addr = DFL_SERVER_ADDR; in get_options()
182 opt.server_port = DFL_SERVER_PORT; in get_options()
183 opt.listen_addr = DFL_LISTEN_ADDR; in get_options()
184 opt.listen_port = DFL_LISTEN_PORT; in get_options()
185 opt.pack = DFL_PACK; in get_options()
188 opt.delay_cli_cnt = 0; in get_options()
189 opt.delay_srv_cnt = 0; in get_options()
190 memset(opt.delay_cli, 0, sizeof(opt.delay_cli)); in get_options()
191 memset(opt.delay_srv, 0, sizeof(opt.delay_srv)); in get_options()
201 opt.server_addr = q; in get_options()
203 opt.server_port = q; in get_options()
205 opt.listen_addr = q; in get_options()
207 opt.listen_port = q; in get_options()
209 opt.duplicate = atoi(q); in get_options()
210 if (opt.duplicate < 0 || opt.duplicate > 20) { in get_options()
214 opt.delay = atoi(q); in get_options()
215 if (opt.delay < 0 || opt.delay > 20 || opt.delay == 1) { in get_options()
219 opt.delay_ccs = atoi(q); in get_options()
220 if (opt.delay_ccs < 0 || opt.delay_ccs > 1) { in get_options()
231 delay_cnt = &opt.delay_cli_cnt; in get_options()
232 delay_list = opt.delay_cli; in get_options()
234 delay_cnt = &opt.delay_srv_cnt; in get_options()
235 delay_list = opt.delay_srv; in get_options()
254 opt.drop = atoi(q); in get_options()
255 if (opt.drop < 0 || opt.drop > 20 || opt.drop == 1) { in get_options()
260 opt.pack = (unsigned) atoi(q); in get_options()
266 opt.mtu = atoi(q); in get_options()
267 if (opt.mtu < 0 || opt.mtu > MAX_MSG_SIZE) { in get_options()
271 opt.bad_ad = atoi(q); in get_options()
272 if (opt.bad_ad < 0 || opt.bad_ad > 1) { in get_options()
278 opt.bad_cid = (unsigned) atoi(q); in get_options()
282 opt.protect_hvr = atoi(q); in get_options()
283 if (opt.protect_hvr < 0 || opt.protect_hvr > 1) { in get_options()
287 opt.protect_len = atoi(q); in get_options()
288 if (opt.protect_len < 0) { in get_options()
292 opt.inject_clihlo = atoi(q); in get_options()
293 if (opt.inject_clihlo < 0 || opt.inject_clihlo > 1) { in get_options()
297 opt.seed = atoi(q); in get_options()
298 if (opt.seed == 0) { in get_options()
407 if (cur_time - buf->packet_lifetime >= opt.pack) { in ctx_buffer_time_remaining()
411 return opt.pack - (cur_time - buf->packet_lifetime); in ctx_buffer_time_remaining()
455 if (opt.pack > 0) { in dispatch_data()
536 if (opt.inject_clihlo != 0 && in send_packet()
544 if (opt.bad_cid != 0 && in send_packet()
546 (rand() % opt.bad_cid) == 0) { in send_packet()
561 if (opt.bad_ad && in send_packet()
586 if (opt.duplicate != 0 && in send_packet()
588 rand() % opt.duplicate == 0) { in send_packet()
598 if (opt.inject_clihlo != 0 && in send_packet()
693 delay_list = opt.delay_cli; in handle_message()
694 delay_list_len = opt.delay_cli_cnt; in handle_message()
696 delay_list = opt.delay_srv; in handle_message()
697 delay_list_len = opt.delay_srv_cnt; in handle_message()
720 if ((opt.mtu != 0 && in handle_message()
721 cur.len > (unsigned) opt.mtu) || in handle_message()
722 (opt.drop != 0 && in handle_message()
725 !(opt.protect_hvr && in handle_message()
727 cur.len != (size_t) opt.protect_len && in handle_message()
729 rand() % opt.drop == 0)) { in handle_message()
731 } else if ((opt.delay_ccs == 1 && in handle_message()
733 (opt.delay != 0 && in handle_message()
736 !(opt.protect_hvr && in handle_message()
738 cur.len != (size_t) opt.protect_len && in handle_message()
740 rand() % opt.delay == 0)) { in handle_message()
790 if (opt.seed == 0) { in main()
792 opt.seed = (unsigned int) mbedtls_time(NULL); in main()
794 opt.seed = 1; in main()
796 mbedtls_printf(" . Pseudo-random seed: %u\n", opt.seed); in main()
799 srand(opt.seed); in main()
805 opt.server_addr, opt.server_port); in main()
808 if ((ret = mbedtls_net_connect(&server_fd, opt.server_addr, opt.server_port, in main()
820 opt.listen_addr, opt.listen_port); in main()
823 if ((ret = mbedtls_net_bind(&listen_fd, opt.listen_addr, opt.listen_port, in main()
864 if (opt.pack > 0) { in main()
879 if (opt.pack > 0) { in main()
955 mbedtls_free(opt.delay_cli[delay_idx]); in main()
956 mbedtls_free(opt.delay_srv[delay_idx]); in main()